mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-24 18:32:23 +00:00
Plug-ins: refuse replacing a compound path's members when one isn't a path
A member that is not a path (a compound path inside a compound path) is not in the input's `path`, so a changed `path` or `type: "path"` deleted it, together with any hidden or locked members it held. The host now refuses such an output with an error naming the compound path. A compound handed back as it was still keeps the member. docs/plugins.md also says that new members keep the old ids by position but not their names or live shapes. The test covers a nested compound member and turning a compound with a guide member into a guide path.
This commit is contained in:
+5
-4
@@ -777,10 +777,11 @@ For an **object filter**, the output is the new state of the input objects:
|
||||
- A `path` returned as it was keeps a live shape live (a rectangle keeps its corner widgets); a changed one makes it a
|
||||
plain path.
|
||||
- A compound path whose `path` is returned as it was, or left out, keeps its members as they are, hidden and locked
|
||||
ones included; a changed `path` replaces its members with one plain member per subpath. The host refuses a `path`
|
||||
with no anchor points, so return a compound path that has none without `path`. While a member is hidden, locked or a
|
||||
guide, the host refuses a changed `path` and `type: "path"` for it (a guide member is allowed when the output also
|
||||
sets `guide`).
|
||||
ones included; a changed `path` replaces its members with one plain member per subpath, which keeps the old members'
|
||||
ids by position but not their names or live shapes. The host refuses a `path` with no anchor points, so return a
|
||||
compound path that has none without `path`. While a member is hidden, locked or a guide, or is not a path (its
|
||||
geometry is not in the input's `path`), the host refuses a changed `path` and `type: "path"` for it (a guide member
|
||||
is allowed when the output also sets `guide`).
|
||||
- The host compares a returned `path` with the input coordinate by coordinate, exactly. A JSON parser that does not
|
||||
read numbers back exactly as they were written (in Rust, `serde_json` without its `float_roundtrip` feature) can
|
||||
change the last digit of a coordinate, so leave `path` out when the geometry does not change.
|
||||
|
||||
Reference in New Issue
Block a user