mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-06 05:53:08 -05:00
Scripts: paths keep the paint they are drawn with as they enter or leave a compound path
- A path that node.move, move or duplicate puts into a compound path loses its own paint, live shape and pixel alignment, as Make Compound Path leaves its paths; the compound path becomes pixel-aligned when the path was. An empty compound path takes the paint the first path was drawn with: the path's own, or that of the compound path it leaves. - A path that node.move or move takes out of a compound path into a layer or a group takes the compound path's paint and pixel alignment, as Release Compound Path gives them to its paths. Before, it kept the empty paint Make Compound Path left it and drew nothing. - Artboard.name = '' gives the artboard its default name, Artboard N, as artboard.setProps gives a blank name, instead of throwing. - The undo step of object.newGroup is named through `label`, so the translators' list reads Compound Path as well as Group. - Tests: a compound path's pathItems list the topmost path first, and a path duplicated into a compound path keeps no paint, live shape or pixel alignment of its own. Docs: docs/mcp.md (the order rule names the document's lists; move, duplicate and node.move name a compound path as a place).
This commit is contained in:
1 parent
de38412a63
commit
ff2ceab181
6 files changed
+242
-43
No files matched your search
@@ -131,8 +131,8 @@ pub(super) fn new_group(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
if !d.is_editable(parent) {
|
||||
return Err(bad(C, "the layer or group is hidden or locked"));
|
||||
}
|
||||
let name = if compound { "Compound Path" } else { "Group" };
|
||||
let gid = s.edit(name, |d, _| {
|
||||
let label = if compound { "Compound Path" } else { "Group" };
|
||||
let gid = s.edit(label, |d, _| {
|
||||
let gid = d.alloc_id();
|
||||
let clips = d.node(parent).is_some_and(Node::clips);
|
||||
let index = if clips { index.max(1) } else { index };
|
||||
|
||||
Reference in new issue
Block a user