From 7658c907322ab4a7b64becc4b9ad7a5ada88c0a3 Mon Sep 17 00:00:00 2001 From: Elena Torro Date: Fri, 24 Jul 2026 12:51:28 +0200 Subject: [PATCH] wip --- render-wasm/src/shapes/stroke_paths.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/render-wasm/src/shapes/stroke_paths.rs b/render-wasm/src/shapes/stroke_paths.rs index cbf06874db..760db720e6 100644 --- a/render-wasm/src/shapes/stroke_paths.rs +++ b/render-wasm/src/shapes/stroke_paths.rs @@ -31,16 +31,17 @@ pub fn stroke_to_path( }; let is_open = shape_path.is_open(); - let mut paint = stroke.to_paint(selrect, svg_attrs, true); + // Use `to_stroked_paint` (not `to_paint`) so the outline expansion picks up + // the stroke's own line caps (`cap_start`/`cap_end`) via `to_skia_linecap()`, + // matching what the on-canvas render does. It also applies the 2×-width + // doubling for inner/outer strokes. + let mut paint = stroke.to_stroked_paint(is_open, selrect, svg_attrs, true); if solid_outline { paint.set_path_effect(None); } let render_kind = stroke.render_kind(is_open); - if render_kind != StrokeKind::Center { - paint.set_stroke_width(stroke.width * 2.0); - } let mut stroke_outline = skia::Path::default(); let success = skia::path_utils::fill_path_with_paint(