diff options
author | 2024-05-08 19:16:06 +0900 | |
---|---|---|
committer | 2024-05-08 19:16:06 +0900 | |
commit | 477887b3870aa5fbdab96c3a06f3b930462d7842 (patch) | |
tree | 2b3272bb178f8757169511966589fe6a106733f4 /tiny_skia/src/engine.rs | |
parent | 0ebe0629cef37aee5c48b9409fc36618a3a3e60d (diff) | |
parent | e07b42ac96b8d098a883c93afe828a439f479c7b (diff) | |
download | iced-477887b3870aa5fbdab96c3a06f3b930462d7842.tar.gz iced-477887b3870aa5fbdab96c3a06f3b930462d7842.tar.bz2 iced-477887b3870aa5fbdab96c3a06f3b930462d7842.zip |
Merge branch 'master' of https://github.com/iced-rs/iced into iced-rs-master
Diffstat (limited to 'tiny_skia/src/engine.rs')
-rw-r--r-- | tiny_skia/src/engine.rs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tiny_skia/src/engine.rs b/tiny_skia/src/engine.rs index fbca1274..028b304f 100644 --- a/tiny_skia/src/engine.rs +++ b/tiny_skia/src/engine.rs @@ -550,6 +550,8 @@ impl Engine { handle, filter_method, bounds, + rotation, + opacity, } => { let physical_bounds = *bounds * _transformation; @@ -560,12 +562,22 @@ impl Engine { let clip_mask = (!physical_bounds.is_within(&_clip_bounds)) .then_some(_clip_mask as &_); + let center = physical_bounds.center(); + let radians = f32::from(*rotation); + + let transform = into_transform(_transformation).post_rotate_at( + radians.to_degrees(), + center.x, + center.y, + ); + self.raster_pipeline.draw( handle, *filter_method, *bounds, + *opacity, _pixels, - into_transform(_transformation), + transform, clip_mask, ); } @@ -574,6 +586,8 @@ impl Engine { handle, color, bounds, + rotation, + opacity, } => { let physical_bounds = *bounds * _transformation; @@ -584,11 +598,22 @@ impl Engine { let clip_mask = (!physical_bounds.is_within(&_clip_bounds)) .then_some(_clip_mask as &_); + let center = physical_bounds.center(); + let radians = f32::from(*rotation); + + let transform = into_transform(_transformation).post_rotate_at( + radians.to_degrees(), + center.x, + center.y, + ); + self.vector_pipeline.draw( handle, *color, physical_bounds, + *opacity, _pixels, + transform, clip_mask, ); } |