summaryrefslogtreecommitdiffstats
path: root/tiny_skia/src/engine.rs
diff options
context:
space:
mode:
authorLibravatar gigas002 <gigas002@pm.me>2024-05-08 19:16:20 +0900
committerLibravatar gigas002 <gigas002@pm.me>2024-05-08 19:16:20 +0900
commitff26fb7df43bd241253af85e0621e2cc030e9cec (patch)
tree2b3272bb178f8757169511966589fe6a106733f4 /tiny_skia/src/engine.rs
parent0ebe0629cef37aee5c48b9409fc36618a3a3e60d (diff)
parent477887b3870aa5fbdab96c3a06f3b930462d7842 (diff)
downloadiced-ff26fb7df43bd241253af85e0621e2cc030e9cec.tar.gz
iced-ff26fb7df43bd241253af85e0621e2cc030e9cec.tar.bz2
iced-ff26fb7df43bd241253af85e0621e2cc030e9cec.zip
Merge branch 'iced-rs-master' into viewer_content_fit
Diffstat (limited to 'tiny_skia/src/engine.rs')
-rw-r--r--tiny_skia/src/engine.rs27
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,
);
}