🐛 Fix text inner stroke fill seam by compositing fill inside SrcIn (#10509)

* 🐛 Fix text inner stroke fill seam by compositing fill inside SrcIn

* 🔧 Update e2e Playwright screenshots
This commit is contained in:
Alejandro Alonso 2026-07-01 16:24:23 +02:00 committed by GitHub
parent 6cc2c403c4
commit f25317ac47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

@ -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() {