Reintroduce improved logic for mesh interior region fill determination (#4464)

This commit is contained in:
Keavon Chambers
2026-09-15 22:56:38 +02:00
committed by Dennis Kobert
parent 1420ba799a
commit 50cda6b134
6 changed files with 649 additions and 59 deletions

View File

@@ -1547,7 +1547,7 @@ fn render_vector_item_svg<S: LaneSource<Element = Vector>>(source: &S, index: us
});
if use_face_fill {
for mut face_path in vector.construct_faces().filter(|face| face.area() >= 0.) {
for mut face_path in vector.construct_faces() {
face_path.apply_affine(Affine::new(applied_stroke_transform.to_cols_array()));
let face_d = face_path.to_svg();
@@ -1646,10 +1646,6 @@ fn render_vector_item_svg<S: LaneSource<Element = Vector>>(source: &S, index: us
attributes.push_val(stroke_shape_attribute);
attributes.push_val(stroke_attribute);
if vector.is_branching() && !use_face_fill {
attributes.push("fill-rule", "evenodd");
}
let opacity = (opacity_attr * if render_params.for_mask { 1. } else { opacity_fill_attr }) as f32;
if opacity < 1. {
attributes.push("opacity", opacity.to_string());
@@ -1868,7 +1864,7 @@ fn render_vector_item_vello<S: LaneSource<Element = Vector>>(
let use_face_fill = element.use_face_fill();
let do_fill = |scene: &mut Scene, context: &mut RenderContext| {
if use_face_fill {
for mut face_path in element.construct_faces().filter(|face| face.area() >= 0.) {
for mut face_path in element.construct_faces() {
face_path.apply_affine(Affine::new(applied_stroke_transform.to_cols_array()));
let mut kurbo_path = kurbo::BezPath::new();
for element in face_path {
@@ -1876,8 +1872,6 @@ fn render_vector_item_vello<S: LaneSource<Element = Vector>>(
}
do_fill_path(scene, context, &kurbo_path, peniko::Fill::NonZero);
}
} else if element.is_branching() {
do_fill_path(scene, context, &path, peniko::Fill::EvenOdd);
} else {
do_fill_path(scene, context, &path, peniko::Fill::NonZero);
}