mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-29 12:56:47 -06:00
M4: text on a path and pattern fills (#118)
Text layers can follow a path (start offset, flip, alignment; edited in place; canvas, PNG, SVG, PDF; SVG textPath imports as real text on a path). A new pattern paint tiles a source layer in grid or hex rows with scale, spacing and alignment, live as the source changes (SVG pattern, PDF vector tiling pattern).
This commit is contained in:
@@ -147,7 +147,7 @@ fn first_fill(n: &Node) -> Option<Color> {
|
||||
n.fills.iter().filter(|p| p.visible).find_map(|p| match &p.kind {
|
||||
PaintKind::Solid { color } => Some(color.with_alpha(color.a * p.opacity)),
|
||||
PaintKind::Gradient(g) => g.sorted_stops().first().map(|s| s.color),
|
||||
PaintKind::Image(_) => None,
|
||||
PaintKind::Image(_) | PaintKind::Pattern(_) => None,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -315,6 +315,7 @@ pub(crate) fn css_decls(doc: &Document, n: &Node, t: &mut Tokens, hug: (bool, bo
|
||||
put("background", format!("linear-gradient({})", stops.join(", ")));
|
||||
}
|
||||
PaintKind::Image(_) => put("background", "url(image.png) center / cover".into()),
|
||||
PaintKind::Pattern(_) => put("background", "url(pattern.png) repeat".into()),
|
||||
}
|
||||
}
|
||||
if let Some(c) = stroke_color(n) {
|
||||
|
||||
Reference in New Issue
Block a user