mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-16 09:35:43 +00:00
Plug-ins: a filter's gradient stop plates are clamped into range like its other colors
A filter's or importer's output clamps each gradient stop's offset, opacity, midpoint, tint and color, but kept its four process plates as given, so a plate below 0, above 1 or infinite was stored in the document. Each plate is now clamped to 0-1: a value that is not a number becomes 0, and an infinite one becomes 0 or 1 by its sign. Painted live effects still refuse such a stop. Docs: docs/plugins.md, docs/target-app-parity.md.
This commit is contained in:
+3
-2
@@ -734,8 +734,9 @@ For an **object filter**, the output is the new state of the input objects:
|
||||
The host validates everything before the document changes: coordinates must be finite and within ±4,000,000 pt, at
|
||||
most 100,000 objects and 4,000,000 anchors, 256 fills, strokes or gradient stops; colours, opacities and offsets are
|
||||
clamped into range, stroke weights to 0–1,000 pt and miter limits to 1–500; a pattern must exist in the document. A
|
||||
paint returned unchanged keeps its swatch link; any other paint is unlinked. One refused effect record refuses the
|
||||
whole output.
|
||||
gradient stop's four process `plates` are clamped to 0–1 as well: a value that is not a number becomes 0, and an
|
||||
infinite one becomes 0 or 1 by its sign. A paint returned unchanged keeps its swatch link; any other paint is
|
||||
unlinked. One refused effect record refuses the whole output.
|
||||
|
||||
A filter's output may also hold `documentData`: any JSON of at most 1 MiB, which replaces what the plug-in keeps with
|
||||
the document (`null` removes it), in the same undo step as its objects. Settings that belong to the whole document
|
||||
|
||||
Reference in New Issue
Block a user