mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 12:51:38 +02:00
🎉 Add text solid strokes (#6384)
* 🎉 Add text strokes * 🔧 Minor refactor
This commit is contained in:
parent
44bf276c49
commit
61eb2f4a19
5 changed files with 166 additions and 23 deletions
|
@ -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, ¶graphs, antialias);
|
||||
text::render(self, &shape, ¶graphs, 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, ¶graphs, antialias);
|
||||
}
|
||||
_ => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue