diff options
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, ); } |