🎉 Add text solid strokes (#6384)

* 🎉 Add text strokes

* 🔧 Minor refactor
This commit is contained in:
Elena Torró 2025-05-07 17:28:36 +02:00 committed by GitHub
parent 44bf276c49
commit 61eb2f4a19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 166 additions and 23 deletions

View file

@ -350,15 +350,32 @@ impl RenderState {
}
}
}
Type::Text(text_content) => {
self.surfaces.apply_mut(&[SurfaceId::Fills], |s| {
s.canvas().concat(&matrix);
});
let paragraphs = text_content.to_skia_paragraphs(&self.fonts.font_collection());
let paragraphs = text_content.get_skia_paragraphs(&self.fonts.font_collection());
shadows::render_text_drop_shadows(self, &shape, &paragraphs, antialias);
text::render(self, &shape, &paragraphs, None, None);
for stroke in shape.strokes().rev() {
let stroke_paints = shape.get_text_stroke_paint(&stroke);
let stroke_paragraphs = text_content
.get_skia_stroke_paragraphs(&self.fonts.font_collection(), &stroke_paints);
shadows::render_text_drop_shadows(self, &shape, &stroke_paragraphs, antialias);
text::render(
self,
&shape,
&stroke_paragraphs,
Some(SurfaceId::Strokes),
None,
);
shadows::render_text_inner_shadows(self, &shape, &stroke_paragraphs, antialias);
}
shadows::render_text_inner_shadows(self, &shape, &paragraphs, antialias);
}
_ => {