Skip to content

Commit

Permalink
Fix paint not being transformed in iced_tiny_skia
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Jan 17, 2024
1 parent acee3b0 commit 5d4c55c
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions tiny_skia/src/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ impl Frame {

let fill = fill.into();

let mut paint = into_paint(fill.style);
paint.shader.transform(self.transform);

self.primitives
.push(Primitive::Custom(primitive::Custom::Fill {
path,
paint: into_paint(fill.style),
paint,
rule: into_fill_rule(fill.rule),
}));
}
Expand All @@ -70,13 +73,16 @@ impl Frame {

let fill = fill.into();

let mut paint = tiny_skia::Paint {
anti_alias: false,
..into_paint(fill.style)
};
paint.shader.transform(self.transform);

self.primitives
.push(Primitive::Custom(primitive::Custom::Fill {
path,
paint: tiny_skia::Paint {
anti_alias: false,
..into_paint(fill.style)
},
paint,
rule: into_fill_rule(fill.rule),
}));
}
Expand All @@ -91,10 +97,13 @@ impl Frame {
let stroke = stroke.into();
let skia_stroke = into_stroke(&stroke);

let mut paint = into_paint(stroke.style);
paint.shader.transform(self.transform);

self.primitives
.push(Primitive::Custom(primitive::Custom::Stroke {
path,
paint: into_paint(stroke.style),
paint,
stroke: skia_stroke,
}));
}
Expand Down

0 comments on commit 5d4c55c

Please sign in to comment.