🐛 Fix exclude boolean rendering in render WASM

This commit is contained in:
Alejandro Alonso 2026-07-22 11:06:00 +02:00
parent 5dff551f31
commit babe0d3c34
2 changed files with 10 additions and 2 deletions

View File

@ -705,16 +705,21 @@ impl Shape {
}
pub fn set_path_segments(&mut self, segments: Vec<Segment>) {
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));
}
_ => {}
};

View File

@ -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);