diff --git a/frontend/playwright/ui/render-wasm-specs/shapes.spec.js-snapshots/BUG-13551---Blurs-affecting-other-elements-1.png b/frontend/playwright/ui/render-wasm-specs/shapes.spec.js-snapshots/BUG-13551---Blurs-affecting-other-elements-1.png index 770c417a65..f1830e82dd 100644 Binary files a/frontend/playwright/ui/render-wasm-specs/shapes.spec.js-snapshots/BUG-13551---Blurs-affecting-other-elements-1.png and b/frontend/playwright/ui/render-wasm-specs/shapes.spec.js-snapshots/BUG-13551---Blurs-affecting-other-elements-1.png differ diff --git a/frontend/playwright/ui/render-wasm-specs/shapes.spec.js-snapshots/Check-inner-stroke-artifacts-1.png b/frontend/playwright/ui/render-wasm-specs/shapes.spec.js-snapshots/Check-inner-stroke-artifacts-1.png index e74e55f39f..88824190be 100644 Binary files a/frontend/playwright/ui/render-wasm-specs/shapes.spec.js-snapshots/Check-inner-stroke-artifacts-1.png and b/frontend/playwright/ui/render-wasm-specs/shapes.spec.js-snapshots/Check-inner-stroke-artifacts-1.png differ diff --git a/frontend/playwright/ui/render-wasm-specs/texts.spec.js-snapshots/Renders-a-file-with-group-with-strokes-and-not-100-opacities-1.png b/frontend/playwright/ui/render-wasm-specs/texts.spec.js-snapshots/Renders-a-file-with-group-with-strokes-and-not-100-opacities-1.png index 54dca6599c..646da5cdb5 100644 Binary files a/frontend/playwright/ui/render-wasm-specs/texts.spec.js-snapshots/Renders-a-file-with-group-with-strokes-and-not-100-opacities-1.png and b/frontend/playwright/ui/render-wasm-specs/texts.spec.js-snapshots/Renders-a-file-with-group-with-strokes-and-not-100-opacities-1.png differ diff --git a/render-wasm/src/render/text.rs b/render-wasm/src/render/text.rs index 4f2d521179..d70993e6b9 100644 --- a/render-wasm/src/render/text.rs +++ b/render-wasm/src/render/text.rs @@ -569,11 +569,11 @@ fn draw_text( /// paint mask — opaque fill as clip mask /// saveLayer(SrcIn) — clips stroke to mask shape /// paint stroke +/// saveLayer(DstOver) — fill behind the stroke +/// paint fill +/// restore /// restore /// restore -/// saveLayer(DstOver) — fill behind the stroke -/// paint fill -/// restore /// restore #[allow(clippy::too_many_arguments)] fn render_inner_stroke_on_canvas( @@ -615,10 +615,7 @@ fn render_inner_stroke_on_canvas( // Draw stroke paint_text(canvas, shape, stroke_builders); - canvas.restore(); // SrcIn layer - canvas.restore(); // mask group layer - - // Fill with DstOver (behind the stroke result) + // Fill with DstOver (behind the stroke, inside SrcIn) let mut dst_over_paint = Paint::default(); dst_over_paint.set_blend_mode(skia::BlendMode::DstOver); canvas.save_layer(&SaveLayerRec::default().paint(&dst_over_paint)); @@ -626,6 +623,8 @@ fn render_inner_stroke_on_canvas( paint_text(canvas, shape, fill_builders); canvas.restore(); // DstOver layer + canvas.restore(); // SrcIn layer + canvas.restore(); // mask group layer canvas.restore(); // outer layer if layer_opacity.is_some() {