mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🎉 Add text fills
This commit is contained in:
@@ -10,7 +10,7 @@ mod strokes;
|
||||
mod surfaces;
|
||||
mod text;
|
||||
|
||||
use skia_safe::{self as skia, image, Matrix, RRect, Rect};
|
||||
use skia_safe::{self as skia, Matrix, RRect, Rect};
|
||||
use std::borrow::Cow;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
@@ -19,7 +19,7 @@ use options::RenderOptions;
|
||||
use surfaces::{SurfaceId, Surfaces};
|
||||
|
||||
use crate::performance;
|
||||
use crate::shapes::{modified_children_ids, Corners, Fill, Shape, StructureEntry, Type};
|
||||
use crate::shapes::{modified_children_ids, Corners, Shape, StructureEntry, Type};
|
||||
use crate::tiles::{self, TileRect, TileViewbox, TileWithDistance};
|
||||
use crate::uuid::Uuid;
|
||||
use crate::view::Viewbox;
|
||||
@@ -427,13 +427,11 @@ impl RenderState {
|
||||
text::render(self, &shape, ¶graphs, None, None);
|
||||
|
||||
for stroke in shape.strokes().rev() {
|
||||
let mut image: Option<image::Image> = None;
|
||||
if let Fill::Image(image_fill) = &stroke.fill {
|
||||
image = self.images.get(&image_fill.id()).cloned();
|
||||
}
|
||||
let stroke_paints = shape.get_text_stroke_paint(stroke, image.as_ref());
|
||||
let stroke_paragraphs = text_content
|
||||
.get_skia_stroke_paragraphs(self.fonts.font_collection(), &stroke_paints);
|
||||
let stroke_paragraphs = text_content.get_skia_stroke_paragraphs(
|
||||
stroke,
|
||||
&shape.selrect(),
|
||||
self.fonts.font_collection(),
|
||||
);
|
||||
shadows::render_text_drop_shadows(self, &shape, &stroke_paragraphs, antialias);
|
||||
text::render(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user