mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-15 07:10:13 +00:00
Effect › SVG Filters and Apply SVG Filter list 14 default filters in every document, before the document's own. The set, the names and the values are VectorCraft's own, written with SVG 1.1 filter primitives (crates/effects/src/svg_filter/defaults.rs). A document holds none of the defaults until one is applied or edited there. svgFilter.apply with a default's name copies it into the document in the same undo step, and svgFilter.define with replace naming a default adds the edited copy under that name. The copy is listed in the default's place. svgFilter.delete refuses a default the document holds no copy of, and deleting the copy lists the default again. svgFilter.list also returns the defaults. svgFilter.apply takes index and item to put the filter in the place of an applied SVG filter, which the dialog's OK uses when it is opened for an applied effect; an index that is not an applied SVG filter, null included, is an error.