Skip to content

Commit 5d4c55c

Browse files
committed
Fix paint not being transformed in iced_tiny_skia
1 parent acee3b0 commit 5d4c55c

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

tiny_skia/src/geometry.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ impl Frame {
4848

4949
let fill = fill.into();
5050

51+
let mut paint = into_paint(fill.style);
52+
paint.shader.transform(self.transform);
53+
5154
self.primitives
5255
.push(Primitive::Custom(primitive::Custom::Fill {
5356
path,
54-
paint: into_paint(fill.style),
57+
paint,
5558
rule: into_fill_rule(fill.rule),
5659
}));
5760
}
@@ -70,13 +73,16 @@ impl Frame {
7073

7174
let fill = fill.into();
7275

76+
let mut paint = tiny_skia::Paint {
77+
anti_alias: false,
78+
..into_paint(fill.style)
79+
};
80+
paint.shader.transform(self.transform);
81+
7382
self.primitives
7483
.push(Primitive::Custom(primitive::Custom::Fill {
7584
path,
76-
paint: tiny_skia::Paint {
77-
anti_alias: false,
78-
..into_paint(fill.style)
79-
},
85+
paint,
8086
rule: into_fill_rule(fill.rule),
8187
}));
8288
}
@@ -91,10 +97,13 @@ impl Frame {
9197
let stroke = stroke.into();
9298
let skia_stroke = into_stroke(&stroke);
9399

100+
let mut paint = into_paint(stroke.style);
101+
paint.shader.transform(self.transform);
102+
94103
self.primitives
95104
.push(Primitive::Custom(primitive::Custom::Stroke {
96105
path,
97-
paint: into_paint(stroke.style),
106+
paint,
98107
stroke: skia_stroke,
99108
}));
100109
}

0 commit comments

Comments
 (0)