diff --git a/render-wasm/src/shapes.rs b/render-wasm/src/shapes.rs index 5dfbe9e384..6930a1a17d 100644 --- a/render-wasm/src/shapes.rs +++ b/render-wasm/src/shapes.rs @@ -705,16 +705,21 @@ impl Shape { } pub fn set_path_segments(&mut self, segments: Vec) { - let path = Path::new(segments); match &mut self.shape_type { Type::Bool(Bool { bool_type, .. }) => { + let path = match bool_type { + // Exclusion booleans are computed with even-odd semantics but + // PathData uploads do not carry the fill rule. + BoolType::Exclusion => Path::new(segments).with_even_odd(true), + _ => Path::new(segments), + }; self.shape_type = Type::Bool(Bool { bool_type: *bool_type, path, }); } Type::Path(_) => { - self.shape_type = Type::Path(path); + self.shape_type = Type::Path(Path::new(segments)); } _ => {} }; diff --git a/render-wasm/src/shapes/paths.rs b/render-wasm/src/shapes/paths.rs index 94f7521c3e..f63b732f15 100644 --- a/render-wasm/src/shapes/paths.rs +++ b/render-wasm/src/shapes/paths.rs @@ -262,6 +262,9 @@ impl Path { pub fn to_skia_path(&self, svg_attrs: Option<&SvgAttrs>) -> skia::Path { let mut path = self.skia_path.snapshot(); + if self.is_even_odd() { + path.set_fill_type(skia::PathFillType::EvenOdd); + } if let Some(attrs) = svg_attrs { if attrs.fill_rule == FillRule::Evenodd { path.set_fill_type(skia::PathFillType::EvenOdd);