summaryrefslogtreecommitdiffstats
path: root/tiny_skia
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-03-01 21:48:27 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-03-01 21:48:27 +0100
commit119cf2ecd10f70471199439acb1c4f9d96a57ced (patch)
treef594e009bfc476d55924a8209c65ad5b12560c39 /tiny_skia
parent838fd96212b14f20fe2224c4844904a8995f2db7 (diff)
downloadiced-119cf2ecd10f70471199439acb1c4f9d96a57ced.tar.gz
iced-119cf2ecd10f70471199439acb1c4f9d96a57ced.tar.bz2
iced-119cf2ecd10f70471199439acb1c4f9d96a57ced.zip
Remove magic boolean in `into_paint`
Diffstat (limited to 'tiny_skia')
-rw-r--r--tiny_skia/src/canvas.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/tiny_skia/src/canvas.rs b/tiny_skia/src/canvas.rs
index 59765f59..958063d2 100644
--- a/tiny_skia/src/canvas.rs
+++ b/tiny_skia/src/canvas.rs
@@ -44,7 +44,7 @@ impl Frame {
self.primitives.push(Primitive::Fill {
path,
- paint: into_paint(fill.style, true),
+ paint: into_paint(fill.style),
rule: into_fill_rule(fill.rule),
transform: self.transform,
});
@@ -61,7 +61,10 @@ impl Frame {
self.primitives.push(Primitive::Fill {
path,
- paint: into_paint(fill.style, false),
+ paint: tiny_skia::Paint {
+ anti_alias: false,
+ ..into_paint(fill.style)
+ },
rule: into_fill_rule(fill.rule),
transform: self.transform,
});
@@ -74,7 +77,7 @@ impl Frame {
self.primitives.push(Primitive::Stroke {
path,
- paint: into_paint(stroke.style, true),
+ paint: into_paint(stroke.style),
stroke: skia_stroke,
transform: self.transform,
});
@@ -207,7 +210,7 @@ fn convert_path(path: &Path) -> tiny_skia::Path {
.expect("Convert lyon path to tiny_skia path")
}
-pub fn into_paint(style: Style, anti_alias: bool) -> tiny_skia::Paint<'static> {
+pub fn into_paint(style: Style) -> tiny_skia::Paint<'static> {
tiny_skia::Paint {
shader: match style {
Style::Solid(color) => tiny_skia::Shader::SolidColor(
@@ -246,7 +249,7 @@ pub fn into_paint(style: Style, anti_alias: bool) -> tiny_skia::Paint<'static> {
.expect("Create linear gradient"),
},
},
- anti_alias,
+ anti_alias: true,
..Default::default()
}
}