Simplify image rotation API and its internals
This commit is contained in:
parent
09a6bcfffc
commit
a57313b23e
23 changed files with 219 additions and 225 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use crate::core::{
|
||||
renderer, Background, Color, Point, Rectangle, Size, Transformation,
|
||||
renderer, Background, Color, Point, Radians, Rectangle, Transformation,
|
||||
};
|
||||
use crate::graphics;
|
||||
use crate::graphics::color;
|
||||
|
|
@ -118,15 +118,13 @@ impl Layer {
|
|||
filter_method: crate::core::image::FilterMethod,
|
||||
bounds: Rectangle,
|
||||
transformation: Transformation,
|
||||
rotation: f32,
|
||||
scale: Size,
|
||||
rotation: Radians,
|
||||
) {
|
||||
let image = Image::Raster {
|
||||
handle,
|
||||
filter_method,
|
||||
bounds: bounds * transformation,
|
||||
rotation,
|
||||
scale,
|
||||
};
|
||||
|
||||
self.images.push(image);
|
||||
|
|
@ -138,15 +136,13 @@ impl Layer {
|
|||
color: Option<Color>,
|
||||
bounds: Rectangle,
|
||||
transformation: Transformation,
|
||||
rotation: f32,
|
||||
scale: Size,
|
||||
rotation: Radians,
|
||||
) {
|
||||
let svg = Image::Vector {
|
||||
handle,
|
||||
color,
|
||||
bounds: bounds * transformation,
|
||||
rotation,
|
||||
scale,
|
||||
};
|
||||
|
||||
self.images.push(svg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue