Export: live effects in symbol art apply in EMF, WMF and SVG

EMF, WMF and SVG wrote a symbol instance from its symbol's art as stored,
so live effects inside that art were missing: a square moved 100 pt by a
Transform effect stayed in place in the file while the canvas drew it
moved. Art whose own place is off the artboard was left out even when
the effect moved it onto it.

These exports now call bake_document_placing_symbols, as PDF, print, EPS
and DXF do: each instance of a symbol whose art needs baking is written
as that art placed by the instance and then baked, so an instance that
scales or turns its art does not scale what its effects do. EMF and SVG
clip 9-slice cells and WMF does not, as each places other instances. In
SVG those instances are written as groups; instances of symbols without
such effects still share one <symbol>. Preserve Editing still embeds the
document with its live effects.

WrittenLayers gains hidden_objects. SVG sets it with Hidden Layers on,
since it then writes hidden objects too, so a hidden instance is written
hidden with its effects applied. The other exporters leave it off.

An SVG instance nested in another instance's art was shared through
<use> when the def allowed its own transform, while the <use> writes
that transform after the outer instances'. A stroked symbol nested in a
scaled instance then drew its stroke at double weight. The check now
uses the transform the <use> writes.
This commit is contained in:
dotCooCoo
2026-11-15 10:57:09 -08:00
parent 5bd8acfce9
commit d4bbacc3eb
12 changed files with 167 additions and 25 deletions
+2 -2
View File
@@ -429,8 +429,8 @@ pub fn export(doc: &Document, opts: &DxfOptions) -> Result<DxfOutput, String> {
return Err("the export region is not finite".into());
}
// Symbols' art is placed without clipping, as the scene places it.
let baked =
vectorcraft_effects::bake_document_placing_symbols(doc, false, vectorcraft_effects::WrittenLayers { hidden: true, non_printing: true });
let layers = vectorcraft_effects::WrittenLayers { hidden: true, non_printing: true, hidden_objects: false };
let baked = vectorcraft_effects::bake_document_placing_symbols(doc, false, layers);
let doc = baked.as_ref().unwrap_or(doc);
Ok(scene::Scene::new(doc, opts).run())
}
+14 -10
View File
@@ -162,7 +162,7 @@ struct Placing {
layers: WrittenLayers,
}
/// The layers an exporter writes besides the shown, printing ones
/// The layers and objects an exporter writes besides the shown, printing ones
/// ([`bake_document_placing_symbols`]). Template layers are never written.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub struct WrittenLayers {
@@ -170,16 +170,19 @@ pub struct WrittenLayers {
pub hidden: bool,
/// Layers that do not print.
pub non_printing: bool,
/// Hidden objects other than layers (written hidden, as SVG writes them when it keeps hidden
/// layers).
pub hidden_objects: bool,
}
/// Does the export leave `n` and everything in it out, while [`bake_document_placing_symbols`]
/// bakes? A hidden object other than a layer, a template layer, and a hidden layer or a layer
/// bakes? A template layer, and a hidden object other than a layer, a hidden layer or a layer
/// that does not print when the export leaves those out ([`WrittenLayers`]).
fn unwritten(n: &Node) -> bool {
PLACING.with(|p| {
p.borrow().as_ref().is_some_and(|p| match n.kind {
NodeKind::Layer { template, printable, .. } => template || !(printable || p.layers.non_printing) || !(n.visible || p.layers.hidden),
_ => !n.visible,
_ => !(n.visible || p.layers.hidden_objects),
})
})
}
@@ -1014,13 +1017,14 @@ pub fn bake_document(doc: &Document) -> Option<Document> {
/// (live geometry effects, color adjustments and the rest [`needs_bake`] counts, in its own art or
/// in the art of the symbols it places) replaced by that art as the instance places it, baked
/// ([`placed_symbol_art`]), so the art draws as on the canvas wherever the instance is. For
/// exporters that write each instance's art in its place (PDF, print, EPS, DXF), rather than
/// writing each symbol once. `clip_slices`: whether 9-slice cells are clipped
/// ([`Document::place_symbol_art`]) or not ([`Document::place_symbol_art_unclipped`]), as the
/// exporter places other instances. `layers`: the hidden layers and layers that do not print
/// that the exporter writes. Instances the export does not write (hidden ones, those in hidden
/// objects, on template layers, and on the layers `layers` leaves out) stay as they are. The
/// symbols' own art is left as it is.
/// exporters that write each instance's art in its place (PDF, print, EPS, DXF, EMF, WMF), and
/// for SVG, which writes the instances of other symbols as one shared definition. `clip_slices`:
/// whether 9-slice cells are clipped ([`Document::place_symbol_art`]) or not
/// ([`Document::place_symbol_art_unclipped`]), as the exporter places other instances. `layers`:
/// the hidden layers, layers that do not print and hidden objects that the exporter writes.
/// Instances the export does not write (template layers, and the hidden objects and layers
/// `layers` leaves out, with what is in them) stay as they are. The symbols' own art is left as
/// it is.
pub fn bake_document_placing_symbols(doc: &Document, clip_slices: bool, layers: WrittenLayers) -> Option<Document> {
bake(doc, Some((clip_slices, vectorcraft_doc::MAX_SYMBOL_NODES, layers)))
}
+12 -2
View File
@@ -1328,7 +1328,7 @@ fn placing_symbols_keeps_the_instances_stain() {
}
/// Every layer written, as DXF writes them (template layers are never written).
const ALL: WrittenLayers = WrittenLayers { hidden: true, non_printing: true };
const ALL: WrittenLayers = WrittenLayers { hidden: true, non_printing: true, hidden_objects: false };
fn is_instance(d: &Document, id: u64) -> bool {
d.node(NodeId(id)).is_some_and(|n| matches!(n.kind, NodeKind::SymbolInstance { .. }))
@@ -1455,10 +1455,20 @@ fn placing_symbols_skips_instances_the_export_leaves_out() {
}
// An export that writes the layers that do not print, or the hidden layers, places that
// layer's instance first; the template layer's instance is never placed.
for (layers, first) in [(WrittenLayers { non_printing: true, hidden: false }, 921), (WrittenLayers { non_printing: false, hidden: true }, 931)] {
for (layers, first) in
[(WrittenLayers { non_printing: true, ..WrittenLayers::default() }, 921), (WrittenLayers { hidden: true, ..WrittenLayers::default() }, 931)]
{
let out = bake(&d, Some((true, each, layers))).unwrap();
assert!(!is_instance(&out, first) && is_instance(&out, 900) && is_instance(&out, 911), "{layers:?}");
}
// An export that writes hidden objects (SVG keeping hidden layers) places the hidden instance
// first, and the instance in the hidden group would come next; the hidden layer's instance
// stays, since that layer is still left out.
let out = bake(&d, Some((true, each, WrittenLayers { hidden_objects: true, ..WrittenLayers::default() }))).unwrap();
assert!(!is_instance(&out, 901), "the hidden instance is placed");
for id in [900, 903, 911, 921, 931] {
assert!(is_instance(&out, id), "{id} stays as it is");
}
}
/// `leaf` in `levels` groups, with ids from `id` up.
+2 -2
View File
@@ -232,8 +232,8 @@ pub fn export(doc: &Document, opts: &EpsOptions, preview: Option<&Raster>, thumb
}
// Type in the document's composite fonts is drawn in them, whether or not an app has the document open.
let _lent = vectorcraft_text::FontDb::global().lend_composite_fonts(&doc.composite_fonts);
let baked =
vectorcraft_effects::bake_document_placing_symbols(doc, true, vectorcraft_effects::WrittenLayers { hidden: false, non_printing: true });
let layers = vectorcraft_effects::WrittenLayers { hidden: false, non_printing: true, hidden_objects: false };
let baked = vectorcraft_effects::bake_document_placing_symbols(doc, true, layers);
let doc = baked.as_ref().unwrap_or(doc);
let page = scene::Scene::new(doc, opts).run();
let mut setting_notes = vec![];
+7 -4
View File
@@ -74,15 +74,18 @@ pub struct Output {
}
/// Write the visible art of `doc` over `region` (document space: its top-left corner is the
/// picture's origin, its size the picture's) as `kind`. Live geometry effects are applied first;
/// template layers, hidden objects and guides are left out. Raster effects should be turned into
/// images before (the engine does); the ones left are reported and left out.
/// picture's origin, its size the picture's) as `kind`. Live geometry effects are applied first,
/// in symbols' art too, where each instance places that art (EMF clips 9-slice cells, WMF does
/// not); template layers, hidden objects and guides are left out. Raster effects should be turned
/// into images before (the engine does); the ones left are reported and left out.
pub fn export(doc: &Document, region: Rect, kind: Kind) -> Result<Output, String> {
let r = region.abs();
if ![r.x0, r.y0, r.x1, r.y1].iter().all(|v| v.is_finite()) || r.width() <= 0.0 || r.height() <= 0.0 {
return Err("the export region is empty".into());
}
let baked = vectorcraft_effects::bake_document(doc);
// The scene writes layers that do not print and leaves hidden layers and objects out.
let layers = vectorcraft_effects::WrittenLayers { hidden: false, non_printing: true, hidden_objects: false };
let baked = vectorcraft_effects::bake_document_placing_symbols(doc, kind == Kind::Emf, layers);
let doc = baked.as_ref().unwrap_or(doc);
let (ops, mut warnings) = scene::Scene::new(doc, r, kind == Kind::Emf).run();
let bytes = match kind {
+37
View File
@@ -85,6 +85,43 @@ fn wmf_output_round_trips() {
assert!(near(ellipse.geometric_bounds().unwrap(), Rect::new(100.0, 20.0, 180.0, 80.0), 0.1));
}
/// A symbol's square that a Transform effect moves 100 pt right is written where the canvas draws
/// it, in EMF and in WMF, read back: art whose own place is off the artboard is written where the
/// effect moves it onto it, and an instance that doubles the art's width places it first, so the
/// effect still moves it 100 pt (to x = 120, not 220). A stained instance keeps its stain.
#[test]
fn symbol_art_effects_are_written_where_they_draw() {
let moved = |rect: Rect| {
let mut art = path(shapes::rectangle(rect), red(), Paint::None, 0.0);
art.appearance.effects.push(vectorcraft_doc::Effect {
id: "distort.transform".into(),
params: [("moveH", 100.0)].into_iter().collect(),
visible: true,
});
art
};
// The art's square, the instance's transform and fill, and the square and color it draws.
let cases = [
(Rect::new(-90.0, 10.0, -80.0, 20.0), Affine::IDENTITY, None, Rect::new(10.0, 10.0, 20.0, 20.0), [255, 0, 0]),
(Rect::new(10.0, 30.0, 20.0, 40.0), Affine::scale_non_uniform(2.0, 1.0), Some(blue()), Rect::new(120.0, 30.0, 140.0, 40.0), [0, 0, 255]),
];
for (square, xf, stain, want, rgb) in cases {
let mut inst = Node::new(vectorcraft_doc::NodeId(0), NodeKind::SymbolInstance { symbol: "Moved".into(), xf });
if let Some(p) = stain {
inst.appearance = vectorcraft_doc::Appearance::basic(p, Paint::None, 0.0).into();
}
let mut d = doc_with(200.0, 100.0, vec![inst]);
d.symbols.push(vectorcraft_doc::Symbol { dynamic: false, name: "Moved".into(), art: std::sync::Arc::new(moved(square)) });
for kind in [Kind::Emf, Kind::Wmf] {
let back = import(&export(&d, d.artboards[0].rect, kind).unwrap().bytes).unwrap();
let drawn: Vec<(Option<Rect>, Option<[u8; 3]>)> = paths(&back.document).iter().map(|n| (n.geometric_bounds(), fill_rgb(n))).collect();
assert_eq!(drawn.len(), 1, "{kind:?} {xf:?}: {drawn:?}");
assert!(drawn[0].0.is_some_and(|b| near(b, want, 0.1)), "{kind:?} {xf:?}: {drawn:?}");
assert_eq!(drawn[0].1, Some(rgb), "{kind:?} {xf:?}");
}
}
}
#[test]
fn freeform_points_that_share_a_model_are_written_as_their_mix() {
use vectorcraft_color::{Color, Freeform, FreeformPoint, GradientKind};
+1
View File
@@ -57,6 +57,7 @@ fn export_with_report_inner(doc: &Document, opts: &PdfOptions, left_out: &mut Ha
let layers = vectorcraft_effects::WrittenLayers {
hidden: set.writes_layers() && !doc.page_knockout,
non_printing: set.include_non_printing || set.create_layers,
hidden_objects: false,
};
let baked = vectorcraft_effects::bake_document_placing_symbols(doc, true, layers);
// Baking stops early when cancelled, leaving a half-baked copy that must not be written.
+1 -1
View File
@@ -187,7 +187,7 @@ pub fn printed_document<'a>(doc: &'a Document, set: &PrintSettings) -> Cow<'a, D
// the art that prints; the layers kept are shown.
let mut kept = doc.clone();
keep_layers(&mut kept.layers, set.print_layers);
let layers = vectorcraft_effects::WrittenLayers { hidden: false, non_printing: true };
let layers = vectorcraft_effects::WrittenLayers { hidden: false, non_printing: true, hidden_objects: false };
let mut d = vectorcraft_effects::bake_document_placing_symbols(&kept, true, layers).unwrap_or(kept);
composite_overprints(&mut d, set);
Cow::Owned(d)
+7 -1
View File
@@ -38,7 +38,13 @@ const UNIQUE_PLACEHOLDER: &str = "u_vc_unique_-";
pub(crate) fn export(doc: &Document, opts: &ExportOptions, native: Option<&[u8]>) -> Output {
// Live geometry effects (Roughen, Warp, Offset Path, Effect → Pathfinder…) export as their result.
let baked = vectorcraft_effects::bake_document(doc);
// An instance of a symbol whose art has such effects is written as that art placed by the
// instance and then baked, as the canvas draws it; other symbols keep one `<symbol>` def.
// Hidden layers and objects are written when the options keep them; layers that do not print
// always are. `native` (Preserve Editing) is the document as it is, with its live effects.
let hidden = opts.hidden_layers;
let layers = vectorcraft_effects::WrittenLayers { hidden, non_printing: true, hidden_objects: hidden };
let baked = vectorcraft_effects::bake_document_placing_symbols(doc, true, layers);
let doc = baked.as_ref().unwrap_or(doc);
if opts.object_ids != ObjectIds::Unique {
return write(doc, opts, native, "");
+4 -3
View File
@@ -1061,8 +1061,8 @@ impl Writer<'_> {
(self.xf, self.instance_xf) = saved;
return;
}
if let Some(def) = self.symbol_use(sym, n, *xf) {
let m = self.xf * *xf;
let m = self.xf * *xf;
if let Some(def) = self.symbol_use(sym, n, m) {
let tr = if m == Affine::IDENTITY { String::new() } else { format!(" transform=\"{}\"", self.matrix(m)) };
self.line(&format!("<use{id} xlink:href=\"#{def}\"{tr}{a}/>"));
return;
@@ -1103,7 +1103,8 @@ impl Writer<'_> {
}
}
/// The id of the `<symbol>` def instance `inst` (transform `xf`) can `<use>`, written on first
/// The id of the `<symbol>` def instance `inst` can `<use>` with transform `xf` (the `<use>`'s
/// own: the instance's transform after those of the instances it sits in), written on first
/// use. `None` when the instance needs its own copy of the art: stained by its fill, or moved
/// by a transform under which the def would not look as the canvas paints it ([`Reuse`]).
fn symbol_use(&mut self, sym: &vectorcraft_doc::Symbol, inst: &Node, xf: Affine) -> Option<String> {
+79
View File
@@ -299,6 +299,85 @@ fn a_stained_instance_with_a_geometry_effect_keeps_its_stain() {
}
}
/// Symbol "Moved": a red square whose Transform effect moves it `dx` pt right.
fn add_moved_symbol(d: &mut Document, square: Rect, dx: f64) {
let mut art = Node::path(d.alloc_id(), shapes::rectangle(square), Appearance::basic(Paint::solid(Color::rgb8(255, 0, 0)), Paint::None, 0.0));
art.appearance.effects.push(vectorcraft_doc::Effect { id: "distort.transform".into(), params: serde_json::json!({"moveH": dx}), visible: true });
d.symbols.push(Symbol { dynamic: false, name: "Moved".into(), art: Arc::new(art) });
}
/// Instances of a symbol whose art has a geometry effect are written as their art placed by the
/// instance and then baked, where the canvas draws it: moved by the instance, doubled in width
/// (the effect still moves it 100 pt, not 200 pt) and turned. They use no `<symbol>`, while the
/// instances of a symbol without effects still share one.
#[test]
fn symbol_art_effects_are_written_where_the_canvas_draws_them() {
let mut d = symbol_doc(0.0, &[Affine::translate((30.0, 100.0)), Affine::translate((60.0, 100.0))]);
add_moved_symbol(&mut d, Rect::new(10.0, 10.0, 20.0, 20.0), 100.0);
instance(&mut d, "Moved", Affine::IDENTITY);
instance(&mut d, "Moved", Affine::translate((0.0, 20.0)) * Affine::scale_non_uniform(2.0, 1.0));
instance(&mut d, "Moved", Affine::translate((-60.0, 40.0)) * Affine::rotate(0.5));
let svg = export(&d, &ExportOptions::default());
assert_eq!((svg.matches("<symbol ").count(), svg.matches("<use ").count()), (1, 2), "{svg}");
assert!(!svg.contains("#Moved"), "{svg}");
let canvas = render_artboard(&d);
// The doubled square draws from x = 120 to 140 (its art placed from 20 to 40, then moved).
assert_eq!(canvas.pixel(130, 35), [255, 0, 0, 255], "the canvas draws the doubled square there");
assert_similar(&canvas, &resvg_render(&svg, 200, 120), 24.0, 0.002);
// Without an artboard, the picture's box is that of the art as drawn: the square moved onto
// x = 10 from x = -90.
let mut d = Document::new(200.0, 120.0);
add_moved_symbol(&mut d, Rect::new(-90.0, 10.0, -80.0, 20.0), 100.0);
instance(&mut d, "Moved", Affine::IDENTITY);
let svg = export(&d, &ExportOptions { artboard: None, ..Default::default() });
assert!(svg.contains("viewBox=\"0 0 10 10\""), "{svg}");
assert_eq!(resvg_render(&svg, 10, 10).pixel(5, 5), [255, 0, 0, 255], "{svg}");
}
/// A hidden instance of a symbol with a geometry effect, kept by Hidden Layers, is written hidden
/// as its art with the effect applied, as a visible one is.
#[test]
fn a_kept_hidden_instance_is_written_with_its_symbols_effects() {
let mut d = Document::new(200.0, 120.0);
add_moved_symbol(&mut d, Rect::new(10.0, 10.0, 20.0, 20.0), 100.0);
let mut hidden = instance(&mut d, "Moved", Affine::IDENTITY);
hidden.visible = false;
let id = hidden.id;
*d.node_mut(id).unwrap() = hidden;
let svg = export(&d, &ExportOptions { hidden_layers: true, ..Default::default() });
assert!(!svg.contains("<use"), "{svg}");
let back = import(&svg).unwrap();
let mut boxes = vec![];
back.walk(|n| {
if !n.visible {
boxes.push(n.geometric_bounds());
}
});
assert_eq!(boxes.len(), 1, "{svg}");
assert!(boxes[0].is_some_and(|b| (b.x0 - 110.0).abs() < 1e-3 && (b.x1 - 120.0).abs() < 1e-3), "{boxes:?}: {svg}");
}
/// An instance nested in the art of a scaled instance that has its own copy of the art is
/// written as its art too when the def can't stand for it under the outer scale: its stroke
/// keeps its weight, as on the canvas, rather than doubling with a scaled `<use>`.
#[test]
fn a_nested_instance_is_shared_only_under_the_transform_it_is_drawn_with() {
let mut d = Document::new(200.0, 120.0);
let ring = Node::path(
d.alloc_id(),
shapes::rectangle(Rect::new(-10.0, -10.0, 10.0, 10.0)),
Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 4.0),
);
d.symbols.push(Symbol { dynamic: false, name: "Ring".into(), art: Arc::new(ring) });
let inner = Node::new(d.alloc_id(), NodeKind::SymbolInstance { symbol: "Ring".into(), xf: Affine::IDENTITY });
d.symbols.push(Symbol { dynamic: false, name: "Holder".into(), art: Arc::new(inner) });
instance(&mut d, "Holder", Affine::translate((100.0, 60.0)) * Affine::scale(2.0));
let svg = export(&d, &ExportOptions::default());
assert_similar(&render_artboard(&d), &resvg_render(&svg, 200, 120), 24.0, 0.002);
assert!(!svg.contains("<use"), "{svg}");
}
#[test]
fn pattern_paints_in_symbols_stay_on_the_page() {
let mut d = Document::new(200.0, 120.0);
+1
View File
@@ -1692,6 +1692,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
A geometry effect on one of type's own fills or strokes reshapes the whole outline that the fill or stroke paints, on the canvas and in exports; PDF, SVG, EPS and the other vector exports write such type as paths. On type that holds inline graphics, those effects are drawn and exported only when the type has a geometry effect or perspective of its own.
A geometry effect on a symbol instance's fill reshapes the filled shapes of the symbol's art and leaves their strokes as they are; one on the instance's stroke reshapes the stroked shapes and leaves their fills as they are. The shapes keep their colors. Only the instance's topmost fill and topmost stroke count, and only while they are visible with an opacity above 0. The canvas and Object › Expand Appearance use the same art, SVG and PDF export bake the same shapes, and Expand Appearance turns the instance into an editable group in one undo step. A group's own fills and strokes in the art take the effects too. An instance inside the art passes the effects on to its own art, and a dynamic symbol's instance reshapes the fills and strokes it paints on the art. How the effects map onto the symbol's art is VectorCraft's own rule. The help page <https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/apply-and-modify-effects.html> describes effects on one fill or stroke, and the help page <https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/expand-objects.html> describes Expand Appearance (engine `expand::a_symbol_instance_fill_effect_reshapes_its_filled_art_and_expands`, `a_symbol_instance_stroke_effect_reshapes_its_stroked_art_and_expands`, `a_stroke_effect_reshapes_a_stroke_a_dynamic_instance_adds`, `a_fill_effect_reshapes_the_fill_of_a_group_in_the_art`, `only_the_topmost_visible_instance_fill_reshapes_the_art`, `a_nested_symbol_instance_takes_the_outer_fill_effect`, `export_bakes_a_symbol_instance_fill_effect`, `a_fill_effect_on_an_instance_of_a_symbol_that_holds_itself_ends`). Existing documents with a geometry effect on a symbol instance's fill or stroke draw differently: before, the effect drew nothing.
Live effects inside a symbol's art (geometry effects, color adjustments and the rest that export bakes) are written where each instance places the art in PDF, print, EPS and DXF, as the canvas draws them: the art is placed first and its effects are applied after, so an instance that scales its art does not scale the distance a Transform effect moves it. Symbols nested in the art, a dynamic symbol instance's own paint changes and the stain an instance's fill gives its art are kept, and the art is stained before its effects apply. A linked instance's PDF link covers its art where the effects draw it. A symbol whose art holds itself stops at the nesting limit, and the symbols' own art keeps its effects. An instance stays an instance in these exports when the objects its art makes once baked (the copies a Transform effect makes included) would take the export's placed symbol art past 16,000,000 objects, or when its baked art would draw deeper than the 128 levels a document may draw; these are VectorCraft's own limits. Art baked for an instance that then stays an instance still counts toward that limit, and while an instance's art bakes, the art's own objects are held in the limit for the instances nested in it. Instances the export leaves out (hidden ones, those in hidden groups, on template layers, and on hidden layers or layers that do not print when the export leaves those out) are not placed and do not count toward that limit. Before, these exports wrote the art without its effects (effects `bake::placing_symbols_bakes_their_art_where_each_instance_places_it`, `placing_symbols_reaches_the_art_of_nested_instances`, `placing_a_symbol_that_holds_itself_stops`, `placing_symbols_keeps_dynamic_instances_changes`, `placing_symbols_keeps_the_instances_stain`, `placing_symbols_counts_the_baked_art`, `placing_symbols_counts_nested_art_once`, `placing_symbols_holds_the_outer_art_while_it_bakes`, `placing_symbols_counts_the_art_it_drops`, `placing_symbols_counts_art_dropped_for_depth_against_later_baked_art`, `placing_symbols_keeps_the_baked_art_within_the_drawn_depth`, `placing_symbols_skips_instances_the_export_leaves_out`; doc `depth::tests::drawn_heights_measure_objects_outside_the_layers`; PDF, print, EPS and DXF `symbol_art_effects_are_written_where_they_draw`, `symbol_art_effects_print_where_they_draw`; PDF `a_stained_instance_keeps_its_stain_when_its_art_has_effects`, `a_linked_instance_keeps_its_link_when_its_art_has_effects`).
EMF, WMF and SVG export write the same symbol art the same way: an instance of a symbol whose art, or the art of a symbol nested in it, has such effects is written as that art placed by the instance and then baked, so a square that a Transform effect moves 100 pt right draws 100 pt right of where the instance places it at any scale or rotation, and art the effect moves onto the artboard is written. EMF and SVG clip 9-slice cells and WMF does not, as each places other instances. In SVG those instances use no `<symbol>`, and instances of symbols without such effects still share one; with Hidden Layers on, hidden instances are placed too and written hidden. An SVG instance nested in another instance's art is shared through `<use>` only when the transform it is drawn with, the outer instances' included, keeps the shared art as the canvas draws it, so a nested stroke keeps its weight in a scaled instance. Preserve Editing still embeds the document with its live effects. Before, these exports wrote the art without its effects (metafile `tests::import::symbol_art_effects_are_written_where_they_draw`; SVG `symbols_layers::symbol_art_effects_are_written_where_the_canvas_draws_them`, `a_kept_hidden_instance_is_written_with_its_symbols_effects`, `a_nested_instance_is_shared_only_under_the_transform_it_is_drawn_with`; effects `bake::placing_symbols_skips_instances_the_export_leaves_out`).
A raster effect (Drop Shadow, Outer Glow, Gaussian Blur and the other effects that paint pixels) on a symbol instance's topmost fill draws on each filled shape of the symbol's art, and one on its topmost stroke draws on each stroked shape, after any geometry effects listed before it, under the same rules as geometry effects: only a visible fill or stroke with an opacity above 0 counts, a group's own fills and strokes in the art take the effect, and an instance inside the art passes it on. Each shape gets its own shadow or glow, which is VectorCraft's own rule. The canvas, Use Preview Bounds and the drawn bounds, SVG and PDF export draw it, and Object › Expand Appearance is enabled for such an instance and makes the effect an image at the document's raster effects resolution, in one undo step (engine `expand::a_symbol_instance_fill_shadow_shadows_its_filled_art`, `a_symbol_instance_stroke_shadow_shadows_only_its_stroked_art`, `a_symbol_instance_fill_shadow_follows_the_fill_offset_before_it`, `a_nested_symbol_instance_takes_the_outer_fill_shadow`, `export_draws_a_symbol_instance_fill_shadow`). Existing documents with a raster effect on a symbol instance's fill or stroke draw differently: before, the effect drew nothing.
The Appearance panel's inline effect editor labels each parameter as the effect dialogs' generic fields do, without the colon ("Max. Radius", "Channel 1", "Create New Fields by"). Roughen's and Zig Zag's Points, Offset Path's Joins, Inner Glow's Source and the menus of Radial Blur, Smart Blur, Sprayed Strokes, Glass, Mezzotint, Halftone Pattern, Grain, Texturizer and De-Interlace are dropdowns with the dialog's labels that send the dialog's values, and a plug-in's choice is a dropdown of the plug-in's values.
Revolve's edge, Extrude & Bevel's bevel, every Warp style's orientation, Rasterize's Color Model, Background and Anti-aliasing and the channel of Levels and Curves are dropdowns too, with the labels their own dialogs show. `effect.apply` and `effect.setParams` refuse a Levels or Curves `channel` other than `rgb`, `red`, `green` or `blue` (or `r`, `g` and `b`, in any letter case).