Effects: each copy of a group's or layer's Transform effect carries the raster effects listed before it

A group's or layer's own Drop Shadow, glow, blur, Feather or pixel filter
listed before its last Transform effect that makes copies now goes with each
copy, made of all the copy's members together. Its sizes scale by the copy's
mean scale, and a Drop Shadow's offset turns, reflects and scales with the
copy. Before, one shadow was drawn around all the copies at the group's own
distances. A raster effect listed after the Transform effect still paints
once around all the copies, and the members' own raster effects stay as a
copying Transform effect leaves them.

Each copy is a group holding the members. A clip group's copies each clip,
a layer's art stays a layer, and its ruler guides stay once above the
copies. Compound shapes, Shaper groups and groups with Pathfinder, 3D, Crop
Marks, Vector Halftone, a painting plug-in, a perspective or fills and
strokes with geometry effects keep the earlier behavior.

The canvas, the object's bounds, baking for export (type in such a group is
no longer kept as type under one shadow), export with raster effects as
images and Expand Appearance draw the same copies. Expand Appearance gives
the copies ids of their own, expanding a copy with a random Transform effect
before its ids change so it keeps the canvas's random values.
This commit is contained in:
dotCooCoo
2026-11-15 16:54:49 -08:00
parent 613f2039e0
commit d436d38fb1
10 changed files with 557 additions and 14 deletions
+8 -2
View File
@@ -715,7 +715,9 @@ fn moved_type_group(n: &Node) -> Option<Node> {
/// Type in a clipping path, other type that [`moved_type`] doesn't copy, and type inside live
/// objects or inside groups with Pathfinder or geometry effects or fills and strokes that paint, is
/// outlined as [`evaluate_container`] outlines it, and the other members become what it makes of
/// them. `None` when no type stays type.
/// them. `None` when no type stays type, and for a group or layer whose copies each carry the raster
/// effects listed before their Transform effect ([`crate::outer_effects`]), which is baked as the
/// canvas draws it ([`evaluate_container`]).
fn container_keeping_type(d: &Document, n: &Node) -> Option<Node> {
fn keep(d: &Document, n: &mut Node, moves: &[serde_json::Value], clipping: bool, kept: &mut bool) {
if !clipping {
@@ -751,7 +753,11 @@ fn container_keeping_type(d: &Document, n: &Node) -> Option<Node> {
}
}
}
if !matches!(n.kind, NodeKind::Group { .. } | NodeKind::Layer { .. }) || has_pathfinder(n) || has_own_paint(n) {
if !matches!(n.kind, NodeKind::Group { .. } | NodeKind::Layer { .. })
|| has_pathfinder(n)
|| has_own_paint(n)
|| crate::reshape::copied_container_raster_at(n).is_some()
{
return None;
}
let fx = geometry_effects(n);
+55 -1
View File
@@ -820,11 +820,15 @@ fn take_sublayer_guides(n: &mut Node, out: &mut Vec<Arc<Node>>, is_guide: &impl
/// transparency, opacity mask and raster effects stay. `None` when it has none of these. Live
/// objects among the members are evaluated with the symbols of `doc` (see [`member_shapes`]), and
/// a Pathfinder operation or compound shape takes the symbol instances among its members as their
/// symbols' art from `doc`.
/// symbols' art from `doc`. A Transform effect that makes copies with raster effects listed before
/// it gives each copy those raster effects ([`copied_container`]).
pub fn evaluate_container(doc: Option<&Document>, n: &Node) -> Option<Node> {
if !is_container(n) {
return None;
}
if let Some(t) = crate::reshape::copied_container_raster_at(n) {
return Some(copied_container(doc, n, t));
}
let pathfinder = has_pathfinder(n);
let fx = crate::reshape::geometry_effects(n);
let paint = has_own_paint(n);
@@ -889,6 +893,56 @@ pub fn evaluate_container(doc: Option<&Document>, n: &Node) -> Option<Node> {
Some(m)
}
/// `n`, a group or layer whose own effects split at `t` ([`crate::reshape::copied_container_raster_at`]),
/// as plain art: the effects before the Transform effect at `t` evaluated on its members as one
/// piece ([`evaluate_container`]), with the raster effects among them, and that piece copied by the
/// Transform effect, each copy a group of its own carrying those raster effects moved, turned,
/// reflected and scaled with it ([`crate::reshape::copied_container_art`]). The art keeps the kind,
/// transparency and opacity mask of `n` and the raster effects from `t` on, which paint once around
/// all the copies; a clip group's or clipping layer's copies each clip, and the art itself does not.
/// Its ruler guides, those in its sublayers and groups included, go once above the copies, hidden
/// and locked as their containers were.
fn copied_container(doc: Option<&Document>, n: &Node, t: usize) -> Node {
let mut m = n.clone();
let mut guides = vec![];
take_sublayer_guides(&mut m, &mut guides, &Node::is_ruler_guide);
let mut source = m.clone();
source.appearance.effects = n.appearance.effects.get(..t).unwrap_or_default().to_vec();
let mut piece = evaluate_container(doc, &source).unwrap_or_else(|| {
let mut p = crate::reshape::outlined_members(doc, &source);
{
// The members' raster effects follow the group's own Transform effects as well.
let _later = crate::raster::LaterGroups::enter(&n.appearance.effects);
members_as_drawn(doc, &mut p);
}
p.appearance.effects = crate::raster::without_geometry(&p.appearance.effects);
p
});
// The piece is one copy: the transparency, opacity mask and guides stay on the art.
piece.name = None;
piece.visible = true;
piece.locked = false;
(piece.opacity, piece.blend, piece.isolate) = (1.0, Default::default(), false);
piece.extras_mut().mask = None;
// A layer's copies are groups in it.
if let NodeKind::Layer { children, clip, .. } = &mut piece.kind {
piece.kind = NodeKind::Group { children: std::mem::take(children), clip: *clip };
}
let (art, effects) = crate::reshape::copied_container_art(doc, n, t, piece);
let copies = art.children().cloned().unwrap_or_default();
if let NodeKind::Group { children, clip } | NodeKind::Layer { children, clip, .. } = &mut m.kind {
*children = copies;
*clip = false;
}
m.appearance.items.clear();
m.appearance.contents_index = None;
m.appearance.effects = effects;
if let Some(ch) = m.children_mut() {
ch.extend(guides);
}
m
}
/// Replace each visible member of `n` with geometry or Pathfinder effects of its own, at every
/// depth of its groups and layers, by the art it draws ([`evaluate_container`],
/// [`crate::reshape::own_effects_art`]), so the geometry effects of `n` reshape what its members
+88 -2
View File
@@ -147,6 +147,91 @@ pub(crate) fn copied_raster_at(n: &Node) -> Option<usize> {
(carried && !excluded).then_some(t)
}
/// Where the own effects of `n`, a group or layer, split so that each copy of a Transform effect
/// carries the raster effects listed before that effect ([`crate::evaluate_container`]), as those of
/// a path split ([`copied_raster_at`]): the index of the last visible Transform effect that makes
/// copies, when a visible raster effect that follows a Transform effect is listed before it and
/// every other visible effect before it is a geometry effect or such a raster effect. `None`
/// otherwise, and for a compound shape, a Shaper group, a group or layer with a Pathfinder effect, a
/// linked opacity mask, a 3D effect, Crop Marks, Vector Halftone, a live-effect plug-in that paints
/// what it returns, a perspective, or a fill or stroke that paints with geometry effects of its own.
pub(crate) fn copied_container_raster_at(n: &Node) -> Option<usize> {
if !matches!(n.kind, NodeKind::Group { .. } | NodeKind::Layer { .. }) {
return None;
}
let effects = &n.appearance.effects;
// Checked first: this runs for every group and layer drawn.
if !effects.iter().any(|e| e.visible && crate::raster::follows(&e.id)) || !effects.iter().any(|e| e.visible && e.id == "distort.transform") {
return None;
}
let t = effects.iter().rposition(|e| {
e.visible && e.id == "distort.transform" && crate::distort::transform_map(Rect::ZERO, &merged_params(&e.id, &e.params), 0).1 > 0
})?;
let before = effects.get(..t)?;
let carried = before.iter().any(|e| e.visible && crate::raster::follows(&e.id))
&& before.iter().all(|e| !e.visible || is_geometry(&e.id) || crate::raster::follows(&e.id));
let excluded = n.is_compound_shape()
|| n.extras().shaper.is_some()
|| crate::has_pathfinder(n)
|| n.extras().mask.as_ref().is_some_and(|m| m.linked)
|| crate::has_solid(n)
|| crate::has_revolve(n)
|| crate::has_crop_marks(n)
|| crate::addons::halftone::has_halftone(n)
|| effects.iter().any(|e| painted_plugin(e).is_some())
|| n.appearance.items.iter().any(|i| crate::paints(i) && crate::has_geometry(i.effects()))
|| n.projection().is_some();
(carried && !excluded).then_some(t)
}
/// `piece`, the art that the effects of `n` (a group or layer whose own effects split at `t`,
/// [`copied_container_raster_at`]) before the Transform effect at `t` make of it, with the raster
/// effects among them as its own, copied by that Transform effect: a group with `n`'s id holding
/// the copies, the last copy lowest and the original on top, each copy's own raster effects moved,
/// turned, reflected and scaled with it ([`crate::raster::follow_contents`]), once, whatever Scale
/// Strokes & Effects says. The members' own raster effects in each copy stay as a Transform effect
/// that copies a group leaves them. The geometry effects after `t` then reshape all the copies as
/// one piece. The copies stop where [`copy_art`]'s do, each with its raster effects. Returns the art
/// and the raster effects from `t` on, as they ran.
pub(crate) fn copied_container_art(doc: Option<&Document>, n: &Node, t: usize, piece: Node) -> (Node, Vec<Effect>) {
let rest = n.appearance.effects.get(t..).unwrap_or_default();
let own = piece.appearance.effects.clone();
let mut art = Node::group(n.id, vec![Arc::new(piece)]);
if let (Some(e), Some(bounds)) = (rest.first(), art.geometric_bounds()) {
let params = merged_params(&e.id, &e.params);
let (m, copies) = crate::distort::transform_map(bounds, &params, n.id.0);
let max = Budget::EFFECTS.at_least(art_cost(&art));
copy_art(&mut art, m, copies, copy_scaling(crate::distort::TransformOptions::of(&params)), max);
if let Some(children) = art.children_mut() {
// The original is last, and each copy above it is mapped once more by `m`.
let step = m.with_translation(vectorcraft_geom::Vec2::ZERO);
let mut a = Affine::IDENTITY;
for (k, c) in children.iter_mut().rev().enumerate() {
// Each copy is the piece in a group of its own: the piece takes its place.
if let Some([one]) = c.children().map(Vec::as_slice) {
*c = one.clone();
}
if k > 0 {
a *= step;
// Scale Strokes & Effects scaled the copy's own effects with it: they follow
// its map from their values on the original instead.
let copy = Arc::make_mut(c);
copy.appearance.effects = own.clone();
crate::raster::follow_contents(&mut copy.appearance.effects, a, Affine::IDENTITY);
}
}
}
}
let later: Vec<&Effect> = rest.iter().skip(1).filter(|e| e.visible && is_geometry(&e.id)).collect();
let carry = reshape_leaves_apart(&mut art, &later, &n.appearance.effects, Budget::EFFECTS, false, doc);
let mut ran = n.appearance.effects.clone();
if carry.skipped() {
carry.hide_skipped(&mut ran);
}
let effects = crate::raster::without_geometry(ran.get(t..).unwrap_or_default());
(art, effects)
}
/// Is `e` a visible live-effect plug-in whose manifest declares `paintOutput`: its id's plug-in id,
/// else `None`.
fn painted_plugin(e: &Effect) -> Option<&str> {
@@ -1083,9 +1168,10 @@ fn copied_raster_art(doc: Option<&Document>, n: &Node, t: usize, apart: bool) ->
}
/// The effects of `n` that paint around its whole art: all of its own, or from the Transform effect
/// on for a path whose copies each carry the raster effects listed before it ([`copied_raster_at`]).
/// on for a path whose copies each carry the raster effects listed before it ([`copied_raster_at`])
/// and for a group or layer whose copies do ([`copied_container_raster_at`]).
pub fn outer_effects(n: &Node) -> &[Effect] {
match copied_raster_at(n) {
match copied_raster_at(n).or_else(|| copied_container_raster_at(n)) {
Some(t) => n.appearance.effects.get(t..).unwrap_or_default(),
None => &n.appearance.effects,
}
+134 -1
View File
@@ -781,7 +781,7 @@ fn a_groups_transform_moves_its_members_shadows() {
}
/// A group's Transform effect that makes copies or moves at random leaves its members' shadows as
/// they are, as it leaves the shadows listed before it in its own effects.
/// they are.
#[test]
fn a_groups_copying_transform_leaves_its_members_shadows() {
for params in [json!({"scaleH": 200, "scaleV": 200, "copies": 1}), json!({"scaleH": 200, "scaleV": 200, "random": true})] {
@@ -792,6 +792,139 @@ fn a_groups_copying_transform_leaves_its_members_shadows() {
}
}
/// A layer of `members` with `effects` of its own.
fn layer(id: u64, members: Vec<Node>, effects: Vec<Effect>) -> Node {
let mut l = Node::layer(NodeId(id), "Layer", vectorcraft_doc::LayerColor::Preset(0));
if let Some(ch) = l.children_mut() {
*ch = members.into_iter().map(std::sync::Arc::new).collect();
}
l.appearance.effects = effects;
l
}
/// The offset and blur of the Drop Shadow that each member of `art` draws of its own, in order.
fn copy_shadows(art: &Node) -> Vec<(f64, f64, f64)> {
art.children().into_iter().flatten().map(|c| drawn_shadow(&c.appearance.effects)).collect()
}
fn close_all(a: &[(f64, f64, f64)], b: &[(f64, f64, f64)]) -> bool {
a.len() == b.len() && a.iter().zip(b).all(|(x, y)| close(*x, *y))
}
/// A group's or layer's Transform effect that makes copies gives each copy the shadow listed
/// before it, moved, turned, reflected and scaled with that copy, the last copy lowest: drawn and
/// baked. Each copy is a group holding all the members, which carry no shadow of their own, and
/// the art paints none around all the copies. With Scale Strokes & Effects on, the shadow is not
/// scaled a second time. A layer's art stays a layer.
#[test]
fn each_copy_of_a_groups_or_layers_transform_effect_carries_the_shadow_listed_before_it() {
let cases = [
(json!({"moveH": 100, "copies": 2}), vec![(10.0, 0.0, 4.0); 3]),
// A turn of 90° counterclockwise on screen takes an offset to the right to one upward.
(json!({"rotate": 90, "copies": 2}), vec![(-10.0, 0.0, 4.0), (0.0, -10.0, 4.0), (10.0, 0.0, 4.0)]),
(json!({"reflectX": true, "moveH": 100, "copies": 1}), vec![(-10.0, 0.0, 4.0), (10.0, 0.0, 4.0)]),
(json!({"scaleH": 200, "scaleV": 200, "moveH": 100, "copies": 1}), vec![(20.0, 0.0, 8.0), (10.0, 0.0, 4.0)]),
(json!({"scaleH": 200, "scaleV": 200, "moveH": 100, "copies": 1, "strokes": true}), vec![(20.0, 0.0, 8.0), (10.0, 0.0, 4.0)]),
];
for (params, want) in cases {
let offsets: Vec<(f64, f64)> = want.iter().map(|w| (w.0, w.1)).collect();
for container in ["group", "layer"] {
let members = vec![square(101, vec![]), square(102, vec![])];
let effects = vec![shadow(10.0, 0.0, 4.0), transform(params.clone())];
let n = if container == "group" { group(100, members, effects) } else { layer(100, members, effects) };
assert!(crate::outer_effects(&n).iter().all(|e| e.id != "stylize.dropShadow"), "{params}: {container}");
let art = crate::evaluate_container(None, &n).unwrap();
assert_eq!(matches!(art.kind, vectorcraft_doc::NodeKind::Layer { .. }), container == "layer", "{params}: {container}");
assert!(raster_effects(&art.appearance.effects).is_empty(), "{params}: {container} {:?}", art.appearance.effects);
let drawn = copy_shadows(&art);
assert!(close_all(&drawn, &want), "{params}: {container} {drawn:?}");
assert_eq!(shadows_in(&art).len(), want.len(), "{params}: {container}: the members draw none");
for c in art.children().into_iter().flatten() {
assert!(matches!(c.kind, vectorcraft_doc::NodeKind::Group { .. }) && paths_in(c) == 2, "{params}: {container} {c:?}");
}
let b = baked(n);
assert!(near(&shadows_in(&b), &offsets), "{params}: {container} baked {:?}", shadows_in(&b));
}
}
}
/// A group's copying Transform effect leaves its members' own shadows on each copy as they are,
/// and a shadow listed after it paints once around all the copies. A clip group's copies each clip
/// and carry the shadow, and the art clips nothing. A Transform effect that makes no copies, or has
/// Transform Objects off, leaves the group's shadows on the group.
#[test]
fn a_groups_copying_transform_leaves_member_and_later_shadows_where_they_paint() {
let g = group(
110,
vec![square(111, vec![shadow(5.0, 5.0, 0.0)]), square(112, vec![])],
vec![shadow(10.0, 0.0, 0.0), transform(json!({"rotate": 90, "copies": 1})), shadow(0.0, 5.0, 0.0)],
);
assert_eq!(crate::outer_effects(&g).len(), 2);
let art = crate::evaluate_container(None, &g).unwrap();
assert!(near(&shadows_in(&art), &[(0.0, 5.0), (0.0, -10.0), (5.0, 5.0), (10.0, 0.0), (5.0, 5.0)]), "{:?}", shadows_in(&art));
let mut clip = square(121, vec![]);
if let vectorcraft_doc::NodeKind::Path { clipping, .. } = &mut clip.kind {
*clipping = true;
}
let mut g = group(120, vec![clip, square(122, vec![])], vec![shadow(10.0, 0.0, 0.0), transform(json!({"moveH": 100, "copies": 1}))]);
if let vectorcraft_doc::NodeKind::Group { clip, .. } = &mut g.kind {
*clip = true;
}
let art = crate::evaluate_container(None, &g).unwrap();
assert!(!art.clips());
assert!(art.children().into_iter().flatten().all(|c| c.clips()), "{art:?}");
assert!(close_all(&copy_shadows(&art), &[(10.0, 0.0, 0.0), (10.0, 0.0, 0.0)]), "{:?}", copy_shadows(&art));
for params in [json!({"rotate": 90}), json!({"rotate": 90, "copies": 1, "objects": false})] {
let g = group(130, vec![square(131, vec![]), square(132, vec![])], vec![shadow(10.0, 0.0, 0.0), transform(params.clone())]);
assert_eq!(crate::outer_effects(&g).len(), 2, "{params}");
let art = crate::evaluate_container(None, &g).unwrap();
assert_eq!(raster_effects(&art.appearance.effects).len(), 1, "{params}: the group keeps its shadow");
}
}
/// Copies of a group that stop at the effect budget each keep their shadow: no copy goes without
/// one, and no shadow is left without its copy.
#[test]
fn a_groups_copies_past_the_budget_each_keep_their_shadow() {
let g = group(140, vec![path_node(141, wavy(30_000), vec![])], vec![shadow(1.0, 0.5, 0.0), transform(json!({"moveV": 50, "copies": 1000}))]);
let art = crate::evaluate_container(None, &g).unwrap();
let paths = paths_in(&art);
assert!(paths > 1 && paths < 1001, "{paths}");
assert_eq!(shadows_in(&art).len(), paths);
}
/// A layer's ruler guides stay once above the copies of its Transform effect, and carry no shadow.
#[test]
fn a_layers_guides_stay_once_above_copies_that_carry_its_shadow() {
let guide = Node::new(NodeId(152), vectorcraft_doc::NodeKind::RulerGuide { vertical: true, pos: 3.0, artboard: None });
let l = layer(150, vec![square(151, vec![]), guide], vec![shadow(10.0, 0.0, 0.0), transform(json!({"moveH": 100, "copies": 2}))]);
let art = crate::evaluate_container(None, &l).unwrap();
let ch = art.children().unwrap();
assert_eq!(ch.len(), 4, "three copies, then the guide");
assert!(ch[3].is_ruler_guide() && ch.iter().filter(|c| c.is_ruler_guide()).count() == 1);
assert_eq!(shadows_in(&art).len(), 3);
}
/// A group holding type whose Transform effect only moves its copies, baked for export, gives each
/// copy the shadow listed before that effect, as the canvas draws it, rather than keeping the type
/// as type under one shadow around all the copies. Built without fonts, type lays out no glyphs
/// and the test is skipped.
#[test]
fn a_baked_group_with_type_keeps_a_shadow_on_each_copy() {
use vectorcraft_doc::text::{CharStyle, TextObject};
let style = CharStyle { size: 40.0, fill: Paint::solid(Color::BLACK), ..Default::default() };
let words = Node::new(NodeId(161), vectorcraft_doc::NodeKind::Text(Box::new(TextObject::point(Point::new(5.0, 60.0), "IIII", style))));
if !crate::outline_text(&words).is_some_and(|o| paths_in(&o) > 0) {
eprintln!("skipped: built without fonts (enable vectorcraft-text's bundled-fonts to run it)");
return;
}
let g = group(160, vec![words, square(162, vec![])], vec![shadow(10.0, 0.0, 0.0), transform(json!({"moveH": 150, "copies": 1}))]);
let b = baked(g);
assert!(near(&shadows_in(&b), &[(10.0, 0.0), (10.0, 0.0)]), "{:?}", shadows_in(&b));
}
/// The Transform effects inside a group apply before the group's: a member's own turn of 90°
/// applies to its shadow before the group's uneven scale does, for the member's own shadow, its
/// fill's shadow, and the shadow of a member of a nested group that has the turn.
+57 -5
View File
@@ -1121,6 +1121,56 @@ fn expand_node_except(d: &mut Document, id: NodeId, brushes: &[vectorcraft_brush
}
}
/// Replace `n`, a group or layer whose Transform effect's copies each carry the raster effects
/// listed before it ([`effects::outer_effects`]), with its art ([`effects::evaluate_container`]):
/// the copies become groups of their own with those effects, and they and what they hold get ids
/// of their own, so they expand as its members do; the raster effects after the Transform effect
/// stay on `n`. A copy that repeats an id ([`repeats_an_id`]) and holds a random Transform effect
/// ([`has_seeded`]) expands before its ids change ([`expand_in_place`]), as [`expand_pieces`] does,
/// and `members` gets what that expansion lists, by the copy's new id. `kept` gets the new id of
/// each copy of an object `skip` lists, and `out` gets `n` unless `listed` says it is there.
/// Returns whether `n` changed; any other object stays as it is.
fn copies_carrying_raster(
d: &mut Document,
n: &mut Node,
(brushes, skip): (&[vectorcraft_brush::Brush], &[NodeId]),
kept: &mut Vec<NodeId>,
members: &mut std::collections::HashMap<NodeId, Vec<Listed>>,
(out, listed): (&mut Vec<Listed>, &mut bool),
) -> bool {
if !is_container(n) || effects::outer_effects(n).len() == n.appearance.effects.len() {
return false;
}
let Some(mut m) = effects::evaluate_container(Some(&*d), n) else { return false };
let mut seen = std::collections::HashSet::from([n.id]);
for c in m.children_mut().into_iter().flatten().filter(|c| !c.is_ruler_guide()) {
let c = Arc::make_mut(c);
let mut expanded = (has_seeded(c) && repeats_an_id(c, &seen)).then(|| expand_in_place(d, c, brushes, skip));
let mut was = vec![];
if !skip.is_empty() {
c.walk(&mut |n| was.push(n.id));
}
fresh_ids_listed(d, c, &mut seen, expanded.as_deref_mut().unwrap_or_default());
// A copy of an object `skip` lists is left as it is too.
let mut at = 0;
c.walk(&mut |n| {
if was.get(at).is_some_and(|old| *old != n.id && skip.contains(old)) {
kept.push(n.id);
}
at += 1;
});
if let Some(expanded) = expanded {
members.insert(c.id, expanded);
}
}
if !*listed {
out.push((n.id, 0));
*listed = true;
}
*n = m;
true
}
/// [`expand_node`] of `n`, which need not be in `d`: `n` with its appearance expanded, `None` when
/// it has nothing to expand. `out` gets the objects whose appearance expands, by places in the walk
/// of the expanded `n`, `n`'s first when its own does. The objects `skip` lists are not expanded.
@@ -1186,15 +1236,17 @@ fn expanded_node(d: &mut Document, mut n: Node, brushes: &[vectorcraft_brush::Br
}
return Some(m);
}
// New ids of the copies of objects `skip` lists among the members.
let mut kept = vec![];
// Members of a group or layer that `expand_pieces` or `copies_carrying_raster` expanded, by id,
// with what their expansion lists.
let mut members = std::collections::HashMap::new();
changed |= copies_carrying_raster(d, &mut n, (brushes, skip), &mut kept, &mut members, (out, &mut listed_n));
let image = raster_image(d, &n);
let mut v = n.clone();
rasterfx::strip_raster(&mut v, false);
let mut stroke_art =
|d: &mut Document, path: &PathData, rule: FillRule, st: &StrokeLayer| super::pathops::outlined_stroke(d, brushes, path, rule, st);
// Members of a group or layer that `expand_pieces` expanded, by id, with what their expansion lists.
let mut members = std::collections::HashMap::new();
// New ids of the copies of objects `skip` lists among those members.
let mut kept = vec![];
let expanded = match image {
// Blur, feather and inner glow change the object itself: it becomes the image (a layer
// keeps it as its only member).
@@ -1206,7 +1258,7 @@ fn expanded_node(d: &mut Document, mut n: Node, brushes: &[vectorcraft_brush::Br
} else if container {
// A group's or layer's own fills and strokes become art among its members.
effects::evaluate_container(Some(&*d), &v).map(|mut m| {
members = expand_pieces(d, &mut m, false, brushes, skip, &mut kept, &mut stroke_art);
members.extend(expand_pieces(d, &mut m, false, brushes, skip, &mut kept, &mut stroke_art));
m
})
} else if matches!(n.kind, NodeKind::Path { .. } | NodeKind::Compound { .. })
+130
View File
@@ -278,6 +278,136 @@ fn each_copys_shadow_expands_as_the_canvas_draws_it() {
assert_eq!(diff, 0, "{diff} pixels differ");
}
/// Each copy of a group's Transform effect draws the drop shadow listed before the effect under
/// itself, of both its squares together and scaled with it, and Expand Appearance keeps those
/// shadows: the squares (20..40 together) have their shadow 20 pt to their right, and their copy
/// scaled 200 % and moved 80 pt down (10..50 across, 90..130 down) has its own 40 pt to its right.
/// A copy moved 30 pt right (50..70) lies under the squares' shadow (40..60), which still paints
/// over it once expanded. The expanded art has no effects left, and each object in it an id of its
/// own.
#[test]
fn each_copys_shadow_on_a_group_expands_as_the_canvas_draws_it() {
let cases = [
(json!({"scaleH": 200, "scaleV": 200, "moveV": 80, "copies": 1}), (80, 110), "the copy's shadow"),
(json!({"moveH": 30, "copies": 1}), (55, 30), "the squares' shadow over the copy"),
];
for (params, (x, y), what) in cases {
let mut s = session();
let mut ids = vec![];
for x in [20, 30] {
ids.push(run(&mut s, "shape.rectangle", json!({"x": x, "y": 20, "width": 10, "height": 20}))["id"].as_u64().unwrap());
run(&mut s, "paint.setFill", json!({"color": "#ff0000"}));
run(&mut s, "paint.setStroke", json!({"none": true}));
}
run(&mut s, "select.set", json!({"ids": ids}));
run(&mut s, "object.group", json!({}));
let shadow = json!({"x": 20, "y": 0, "blur": 0, "opacity": 100, "mode": "normal", "color": "#00ff00"});
run(&mut s, "effect.apply", json!({"effect": "stylize.dropShadow", "params": shadow}));
run(&mut s, "effect.apply", json!({"effect": "distort.transform", "params": params}));
let before = render(&s);
assert_eq!(before.pixel(x, y), [0, 255, 0, 255], "{params}: {what}");
run(&mut s, "effect.expandAppearance", json!({}));
let after = render(&s);
let diff = differing(&before, &after, 64);
assert_eq!(diff, 0, "{params}: {diff} pixels differ");
let doc = &s.doc().unwrap().doc;
let (mut seen, mut count, mut effects) = (std::collections::HashSet::new(), 0, 0);
for l in &doc.layers {
l.walk(&mut |n| {
seen.insert(n.id);
count += 1;
effects += n.appearance.effects.len();
});
}
assert_eq!(seen.len(), count, "{params}: each object has an id of its own");
assert_eq!(effects, 0, "{params}: no effects are left");
}
}
/// A member's random Transform effect takes its seed from the member's id, and the canvas draws
/// every copy of the group with that id: Expand Appearance of a group with a stroke of its own, a
/// shadow and a copying Transform effect gives each copy's symbol instance the same random move, so
/// the copies, 60 pt apart, still draw alike.
#[test]
fn each_copys_random_member_expands_as_the_canvas_draws_it() {
let mut s = session();
let mut ids = vec![];
for x in [20, 50] {
ids.push(run(&mut s, "shape.rectangle", json!({"x": x, "y": 20, "width": 20, "height": 20}))["id"].as_u64().unwrap());
run(&mut s, "paint.setFill", json!({"color": "#ff0000"}));
run(&mut s, "paint.setStroke", json!({"none": true}));
}
run(&mut s, "select.set", json!({"ids": [ids[0]]}));
ids[0] = run(&mut s, "symbol.new", json!({"name": "Box"}))["id"].as_u64().unwrap();
run(&mut s, "select.set", json!({"ids": [ids[0]]}));
run(&mut s, "effect.apply", json!({"effect": "distort.transform", "params": {"moveH": 16, "moveV": 16, "random": true}}));
run(&mut s, "select.set", json!({"ids": ids}));
let g = run(&mut s, "object.group", json!({}))["id"].as_u64().unwrap();
run(&mut s, "select.set", json!({"ids": [g]}));
run(&mut s, "appearance.addStroke", json!({}));
assert!(node(&s, NodeId(g)).appearance.items.iter().any(|i| i.visible()), "the group has a stroke of its own");
let shadow = json!({"x": 10, "y": 0, "blur": 0, "opacity": 100, "mode": "normal", "color": "#00ff00"});
run(&mut s, "effect.apply", json!({"effect": "stylize.dropShadow", "params": shadow}));
run(&mut s, "effect.apply", json!({"effect": "distort.transform", "params": {"moveV": 60, "copies": 2}}));
// The pixels of each copy's 60 pt band that differ from the first copy's by more than 64.
let unlike = |r: &vectorcraft_render::Rendered| {
let px = |x: usize, y: usize| {
let i = (y * r.width as usize + x) * 4;
r.pixels.get(i..i + 4).map(<[u8]>::to_vec).unwrap_or_default()
};
let mut n = 0;
for k in [60, 120] {
for y in 0..60 {
for x in 0..r.width as usize {
n += usize::from(px(x, y).iter().zip(px(x, y + k)).any(|(a, b)| a.abs_diff(b) > 64));
}
}
}
n
};
let before = render(&s);
assert_eq!(unlike(&before), 0, "the canvas draws the copies alike");
let art = vectorcraft_render::effects::evaluate_container(Some(&s.doc().unwrap().doc), &node(&s, NodeId(g))).unwrap();
let mut live = 0;
art.walk(&mut |n| live += n.appearance.effects.iter().filter(|e| e.id == "distort.transform").count());
assert_eq!(live, 3, "each copy's instance keeps its random effect live");
run(&mut s, "effect.expandAppearance", json!({}));
let after = render(&s);
assert_eq!(unlike(&after), 0, "the expanded copies draw alike");
assert!(differing(&before, &after, 64) < 200, "the copies stay where they are drawn");
}
/// A member's own Offset Path applies before the copying Transform effect of its group, which has
/// a stroke of its own, whether or not a shadow is listed before that Transform effect: the copy
/// scaled 200 % draws the offset square scaled, with or without a shadow at 0 % opacity.
#[test]
fn a_members_offset_path_applies_before_its_painted_groups_copies() {
let draw = |shadow: bool| {
let mut s = session();
let mut ids = vec![];
for x in [20, 40] {
ids.push(run(&mut s, "shape.rectangle", json!({"x": x, "y": 20, "width": 10, "height": 10}))["id"].as_u64().unwrap());
run(&mut s, "paint.setFill", json!({"color": "#ff0000"}));
run(&mut s, "paint.setStroke", json!({"none": true}));
}
run(&mut s, "select.set", json!({"ids": [ids[0]]}));
run(&mut s, "effect.apply", json!({"effect": "path.offsetPath", "params": {"offset": 5}}));
run(&mut s, "select.set", json!({"ids": ids}));
let g = NodeId(run(&mut s, "object.group", json!({}))["id"].as_u64().unwrap());
run(&mut s, "appearance.addStroke", json!({}));
if shadow {
let fx = json!({"x": 10, "y": 0, "blur": 0, "opacity": 0, "mode": "normal", "color": "#00ff00"});
run(&mut s, "effect.apply", json!({"effect": "stylize.dropShadow", "params": fx}));
}
run(&mut s, "effect.apply", json!({"effect": "distort.transform", "params": {"scaleH": 200, "scaleV": 200, "moveV": 60, "copies": 1}}));
let n = node(&s, g);
assert_eq!(vectorcraft_render::effects::outer_effects(&n).len() < n.appearance.effects.len(), shadow, "each copy carries the shadow");
render(&s)
};
let diff = differing(&draw(false), &draw(true), 64);
assert_eq!(diff, 0, "{diff} pixels differ");
}
/// A group's Transform effect runs after its member's own Offset Path in Expand Appearance as on
/// the canvas: the 100 pt square offset to 120 pt and scaled by half expands 60 pt wide.
#[test]
+39
View File
@@ -191,6 +191,45 @@ fn shadows_and_glows_keep_their_blend_modes() {
assert_eq!(modes, [vectorcraft_color::BlendMode::Multiply, vectorcraft_color::BlendMode::Screen]);
}
/// Each copy of a group's Transform effect has its own image of the shadow listed before the
/// effect, under that copy: the squares' shadow (40..60) paints over their copy moved 30 pt right
/// (50..70), as on the canvas, and the copies' objects have ids of their own.
#[test]
fn each_copys_shadow_on_a_group_flattens_under_that_copy() {
let mut d = Document::new(200.0, 200.0);
let members = [20.0, 30.0].map(|x| Arc::new(rect(&mut d, Rect::new(x, 40.0, x + 10.0, 60.0), Color::rgb(1.0, 0.0, 0.0))));
let mut g = Node::group(d.alloc_id(), members.to_vec());
g.appearance.effects = vec![
Effect {
id: "stylize.dropShadow".into(),
params: json!({"x": 20.0, "y": 0.0, "blur": 0.0, "opacity": 100.0, "mode": "normal", "color": "#00ff00"}),
visible: true,
},
Effect { id: "distort.transform".into(), params: json!({"moveH": 30.0, "copies": 1}), visible: true },
];
add(&mut d, g);
let canvas = render(&d);
let flat = crate::flatten_raster_effects(&d).unwrap();
let back = render(&flat);
let at = |r: &Rendered, x: usize| {
let i = (50 * r.width as usize + x) * 4;
(r.pixels[i], r.pixels[i + 1], r.pixels[i + 2])
};
for x in [55, 65, 85] {
let (want, got) = (at(&canvas, x), at(&back, x));
assert!(want.0.abs_diff(got.0) < 32 && want.1.abs_diff(got.1) < 32 && want.2.abs_diff(got.2) < 32, "x {x}: {want:?} {got:?}");
}
assert!(at(&back, 55).1 > 200 && at(&back, 55).0 < 60, "the squares' shadow over the copy: {:?}", at(&back, 55));
let (mut seen, mut count) = (std::collections::HashSet::new(), 0);
for l in &flat.layers {
l.walk(&mut |n| {
seen.insert(n.id);
count += 1;
});
}
assert_eq!(seen.len(), count, "each object has an id of its own");
}
#[test]
fn pdf_resolution_cap_warns_once_for_original_object_when_appearance_items_split() {
let mut d = Document::new(300.0, 300.0);
+4 -2
View File
@@ -780,9 +780,11 @@ pub(crate) fn three_d_art_bounds(symbols: &SymbolBoxes, art: &Node) -> Option<Re
pieces(symbols, &art)
}
/// `b`, the bounds of what `n` draws, grown by how far `n`'s own raster effects paint past it.
/// `b`, the bounds of what `n` draws, grown by how far `n`'s own raster effects paint past it: those
/// around its whole art ([`effects::outer_effects`]), as the copies of a Transform effect that carry
/// the ones listed before it are measured in `b`.
pub(crate) fn with_own_raster_reach(symbols: &SymbolBoxes, n: &Node, b: Rect) -> Rect {
let o = outset(symbols, &n.appearance.effects, b);
let o = outset(symbols, effects::outer_effects(n), b);
b.inflate(o, o)
}
+40
View File
@@ -1242,3 +1242,43 @@ fn each_copy_of_a_transform_effect_draws_its_own_shadow() {
let b = crate::fx::visual_bounds(&d.symbol_boxes(), n).unwrap();
assert!(b.x1 >= 80.0 - 1e-9, "{b:?}");
}
/// Each copy of a group's or layer's Transform effect draws the drop shadow listed before the
/// effect under itself, of all its members together and scaled with it: two red squares side by
/// side (10..30 together) have one green shadow 20 pt to their right, and their copy scaled 200 %
/// and moved 60 pt down (0..40 across, 60..100 down) has its own 40 pt to its right. The bounds
/// reach as far as the copy's shadow, and no further.
#[test]
fn each_copy_of_a_groups_or_layers_transform_effect_draws_its_own_shadow() {
let shadow = fx("stylize.dropShadow", json!({"x": 20, "y": 0, "blur": 0, "opacity": 100, "mode": "normal", "color": "#00ff00"}));
let copies = fx("distort.transform", json!({"scaleH": 200, "scaleV": 200, "moveV": 60, "copies": 1}));
let red = Appearance::basic(Paint::solid(Color::rgb(1.0, 0.0, 0.0)), Paint::None, 0.0);
for layer in [false, true] {
let mut d = Document::new(100.0, 100.0);
let members: Vec<Arc<Node>> = [Rect::new(10.0, 10.0, 20.0, 30.0), Rect::new(20.0, 10.0, 30.0, 30.0)]
.into_iter()
.map(|r| Arc::new(Node::path(d.alloc_id(), shapes::rectangle(r), red.clone())))
.collect();
if layer {
let l = Arc::make_mut(&mut d.layers[0]);
if let Some(ch) = l.children_mut() {
*ch = members;
}
l.appearance.effects = vec![shadow.clone(), copies.clone()];
} else {
let mut g = Node::group(d.alloc_id(), members);
g.appearance.effects = vec![shadow.clone(), copies.clone()];
let l = d.layers[0].id;
d.insert(Some(l), 0, g).unwrap();
}
let img = render(&d);
assert_eq!(img.pixel(20, 20), [255, 0, 0, 255], "layer {layer}: the squares");
assert_eq!(img.pixel(45, 20), [0, 255, 0, 255], "layer {layer}: the squares' shadow");
assert_eq!(img.pixel(20, 80), [255, 0, 0, 255], "layer {layer}: the copy");
assert_eq!(img.pixel(70, 80), [0, 255, 0, 255], "layer {layer}: the copy's shadow, 40 pt to its right");
assert_eq!(img.pixel(85, 80), [255, 255, 255, 255], "layer {layer}: past the copy's shadow");
let n = if layer { d.layers[0].clone() } else { d.layers[0].children().unwrap()[0].clone() };
let b = crate::brush_fx::cull_bounds(&d.symbol_boxes(), &n).unwrap();
assert!((b.x1 - 80.0).abs() < 1e-9, "layer {layer}: {b:?}");
}
}
+2 -1
View File
@@ -634,7 +634,8 @@ since 2026-10-01.
- **Selected Mirror Repeat handles:** a headless canvas regression creates the default mirror repeat and drags its Top bounding-box handle where the axis crosses it; the repeat grows vertically while its width stays fixed. Existing mirror-axis checks cover center movement and end-handle hit priority. The focused UI mirror tests pass. Scores and hours unchanged.
- **Transform effect options (#885):** Effect › Distort & Transform › Transform… has visible Transform Objects, Transform Patterns and Scale Strokes & Effects checkboxes (`distort.transform` params `objects`, `patterns`, `strokes`; files without them draw as before). With Transform Objects off the geometry stays and makes no copies; Scale Strokes & Effects scales stroke weights, dashes and the fills' and strokes' effect distances by the mean scale, and Transform Patterns moves pattern tiles, each copy `k` by the transformation `k` times. Such objects draw, export and expand through the same per-copy art, so the canvas and Expand Appearance agree (engine `tests_transformfx`, effects `tests_transformfx`, the dialog test). A Transform effect in a fill's or stroke's own effects applies the same options to that fill or stroke: its weight and dashes and its pattern follow the transformation, and with copies each copy is an object of its own; the canvas, export, Expand Appearance and Use Preview Bounds use the same art (effects `tests_transformfx`). The effects listed after it in that fill's or stroke's list keep their own distances and apply to the transformed art and to each copy, as an object's later effects do after the object's Transform effect: a Drop Shadow after it keeps its offset, an Offset Path after it offsets by its own distance, and an SVG filter after it keeps its scale and the origin of its user space. With Transform Objects off, the effects before it keep their distances too. Before, Scale Strokes & Effects scaled a fill's or stroke's later effects by the mean scale, so existing documents with such effects draw differently. Effects apply in the order they are listed ([Appearance attributes](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-graphic-styles/appearance-attributes-in-illustrator.html)); how the two options treat the effects after a fill's or stroke's own Transform effect is VectorCraft's own rule, following that order (effects `tests::rasterfollow::a_fills_own_transform_leaves_the_shadow_after_it`, `tests::rasterfollow::a_fills_own_transform_leaves_the_offset_after_it`, `tests::rasterfollow::a_fills_own_transform_leaves_the_svg_filter_after_it`, `tests::transformfx::a_fills_own_transform_with_scale_strokes_and_effects_leaves_its_later_effects`; engine `plugins::a_transform_after_a_painted_fill_effect_leaves_the_later_shadow_on_every_paint`). Public reference: [Scale objects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/scale-objects.html), [How to apply effects](https://helpx.adobe.com/illustrator/using/effects.html), [Distort and transform effects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/distort-and-transform-effects-in-illustrator.html). Scores and hours unchanged.
- **Raster effects before a Transform effect:** effects apply in the order they are listed ([Appearance attributes](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-graphic-styles/appearance-attributes-in-illustrator.html)). A Drop Shadow, glow, blur, Feather or pixel filter listed before a Transform effect in the same list (an object's effects, or a fill's or stroke's own) now follows that Transform effect: its sizes scale by the mean scale, and a Drop Shadow's offset turns, reflects and scales with the art. VectorCraft applies this rule with Scale Strokes & Effects on or off. Before, such an effect was drawn at its own distances around the transformed art. The canvas, export, Expand Appearance, Object › Expand, Outline Stroke and the 3D effects use the same values (effects `tests::rasterfollow`; render `a_transform_after_a_drop_shadow_scales_the_shadow_with_the_art`; engine `objexpand::a_shadow_before_a_transform_expands_as_the_canvas_draws_it`, `outlinestroke::a_shadow_before_a_transform_outlines_as_the_canvas_draws_it`). Not yet: a Transform effect that makes copies or moves at random leaves the raster effects before it as they are. The light direction of Underpainting, Rough Pastels, Conté Crayon, Bas Relief, Plaster and Texturizer and the stroke direction of Sprayed Strokes and Graphic Pen now turn and reflect with such a Transform effect, each set to the nearest of its menu's choices (at a tie, the one clockwise of it; VectorCraft's own rule), and Color Halftone's four screen angles turn and reflect with the art ([Distort and transform effects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/distort-and-transform-effects-in-illustrator.html); effects `tests::rasterfollow::bas_relief_light_follows_rotation_and_reflection` and the tests after it). Not yet: filters whose strokes or patterns run along fixed page axes without a direction setting (Angled Strokes, Crosshatch, Mezzotint's lines, Halftone Pattern's lines, Grain's horizontal and vertical types, De-Interlace) keep those axes, and an uneven scale or a shear sets a direction from the one vector it maps, not a skewed pattern. Scores and hours unchanged.
- **Raster effects before a Transform effect that makes copies:** the Transform effect can make copies with its transformation applied ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/distort-and-transform-effects-in-illustrator.html)). Giving each copy the raster effects listed before that effect is VectorCraft's own rule. On a path or compound path, each copy now carries the Drop Shadow, glow, blur, Feather or pixel filter listed before the last Transform effect that makes copies, with its sizes scaled by that copy's mean scale and a Drop Shadow's offset turned, reflected and scaled with the copy; a raster effect listed after it paints once around all the copies. Before, one shadow was drawn under all the copies at the object's own distances. The canvas, the object's bounds, export and Expand Appearance draw the same copies, and copies that stop at the effect budget each keep their effects (effects `tests::rasterfollow::each_copy_of_a_transform_effect_carries_the_shadow_listed_before_it`, `tests::rasterfollow::a_shadow_after_a_copying_transform_paints_once_around_the_copies`, `tests::rasterfollow::copies_past_the_budget_each_keep_their_shadow`; render `objectfx::each_copy_of_a_transform_effect_draws_its_own_shadow`; engine `objexpand::each_copys_shadow_expands_as_the_canvas_draws_it`). A Transform effect without copies draws as before. Not yet: the copies of type, images, symbol instances and groups, and a fill's or stroke's own copying Transform effect, still share one set of raster effects, and so does a path with Rasterize, an SVG filter or another effect that is neither a geometry effect nor one of those raster effects before the copying effect. Scores and hours unchanged.
- **Raster effects before a Transform effect that makes copies:** the Transform effect can make copies with its transformation applied ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/distort-and-transform-effects-in-illustrator.html)). Giving each copy the raster effects listed before that effect is VectorCraft's own rule. On a path or compound path, each copy now carries the Drop Shadow, glow, blur, Feather or pixel filter listed before the last Transform effect that makes copies, with its sizes scaled by that copy's mean scale and a Drop Shadow's offset turned, reflected and scaled with the copy; a raster effect listed after it paints once around all the copies. Before, one shadow was drawn under all the copies at the object's own distances. The canvas, the object's bounds, export and Expand Appearance draw the same copies, and copies that stop at the effect budget each keep their effects (effects `tests::rasterfollow::each_copy_of_a_transform_effect_carries_the_shadow_listed_before_it`, `tests::rasterfollow::a_shadow_after_a_copying_transform_paints_once_around_the_copies`, `tests::rasterfollow::copies_past_the_budget_each_keep_their_shadow`; render `objectfx::each_copy_of_a_transform_effect_draws_its_own_shadow`; engine `objexpand::each_copys_shadow_expands_as_the_canvas_draws_it`). A Transform effect without copies draws as before. Not yet: the copies of type, images and symbol instances, and a fill's or stroke's own copying Transform effect, still share one set of raster effects, and so does a path with Rasterize, an SVG filter or another effect that is neither a geometry effect nor one of those raster effects before the copying effect. Scores and hours unchanged.
- **Raster effects before a group's or layer's Transform effect that makes copies:** groups and layers can carry effects of their own ([the help page](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/vector-and-raster-effects.html)), and the rule above for paths now covers them as VectorCraft's own rule. Each copy of a group's or layer's own last Transform effect that makes copies carries the Drop Shadow, glow, blur, Feather or pixel filter listed before that effect, made of all the copy's members together, with its sizes scaled by that copy's mean scale and a Drop Shadow's offset turned, reflected and scaled with the copy; a raster effect listed after it paints once around all the copies, and the members' own raster effects in each copy stay as a copying Transform effect leaves them. Before, one shadow was drawn around all the copies at the group's own distances. A clip group's copies each clip, and a layer's ruler guides stay once above the copies. The canvas, the bounds, export with raster effects as images and Expand Appearance draw the same copies, and copies that stop at the effect budget each keep their effects (effects `tests::rasterfollow::each_copy_of_a_groups_or_layers_transform_effect_carries_the_shadow_listed_before_it`, `tests::rasterfollow::a_groups_copying_transform_leaves_member_and_later_shadows_where_they_paint`, `tests::rasterfollow::a_groups_copies_past_the_budget_each_keep_their_shadow`, `tests::rasterfollow::a_layers_guides_stay_once_above_copies_that_carry_its_shadow`, `tests::rasterfollow::a_baked_group_with_type_keeps_a_shadow_on_each_copy`; render `objectfx::each_copy_of_a_groups_or_layers_transform_effect_draws_its_own_shadow`; engine `objexpand::each_copys_shadow_on_a_group_expands_as_the_canvas_draws_it`, `objexpand::each_copys_random_member_expands_as_the_canvas_draws_it`, `pdfraster::each_copys_shadow_on_a_group_flattens_under_that_copy`). Not yet: a compound shape, a Shaper group, and a group or layer with a Pathfinder effect, a 3D effect, Crop Marks, Vector Halftone, a live-effect plug-in that paints what it returns, a perspective or a fill or stroke with geometry effects of its own keep one set of raster effects around their copies. Scores and hours unchanged.
- **Rasterize before a Transform effect:** effects apply in the order they are listed, each one taking the result of the one before ([the help page](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-graphic-styles/appearance-attributes-in-illustrator.html)). On a path or compound path, a Transform effect listed after the object's own Rasterize effect now moves the image that Rasterize makes: the image is made of the art before the Transform effect, at the Rasterize effect's resolution and with its room around the art, and the Transform effect scales, turns, reflects and moves the image with its pixel grid. Before, the Transform effect moved the art and Rasterize made a new image of the moved art on a grid square to the page. Keeping the image's pixel grid under the Transform effect is VectorCraft's own rule. A hidden Transform effect, or one with Transform Objects off, leaves the image where it is, and one that scales it to nothing leaves nothing drawn. The canvas, the object's bounds, Expand Appearance and PDF export draw the same image (effects `tests::rasterfollow::rasterize_following_ignores_hidden_and_objects_off`, `tests::rasterfollow::the_image_moves_by_each_transform_about_the_art_it_takes`; render `rasterize::rasterize_then_scale_uses_the_pretransform_pixels`, `rasterize::rasterize_then_rotate_and_reflect_moves_the_pixel_grid`, `rasterize::rasterize_then_nonuniform_scale_and_zero_scale_are_bounded`; engine `rastersettings::expand_rasterize_then_transform_matches_canvas`). Not yet: a Transform effect that makes copies or moves at random, a Transform effect followed by another kind of effect, a fill's or stroke's own Rasterize effect, and Rasterize on type, images, symbol instances and groups keep the earlier behavior. Scores and hours unchanged.
- **Raster effects before a Transform effect past the effect budget:** VectorCraft leaves out a Transform effect whose result would pass its geometry budget of 2 million anchors or 8 million lines drawn, and the art stays where it was. The raster effects listed before that Transform effect now stay with the art too: a Drop Shadow keeps its own offset and blur, and the Transform effects after it that fit still move both. Before, the art stayed while the shadow scaled with the Transform effect it did not take. This is VectorCraft's own rule. It applies to a path's own effects and to its fills' and strokes' own, also when the path is in a group whose geometry effects run after its members' own, on the canvas and in its bounds, in export, Expand Appearance, Object › Expand and Outline Stroke, and a hidden shadow keeps its values once shown (effects `tests::rasterfollow::a_transform_past_the_line_budget_moves_the_art_with_its_shadow`, `tests::rasterfollow::only_transforms_that_ran_move_a_preceding_shadow`, `tests::rasterfollow::a_skipped_item_transform_keeps_its_shadow`, `tests::rasterfollow::the_shape_art_of_a_skipped_transform_keeps_its_shadows`, `tests::rasterfollow::a_members_skipped_transform_keeps_its_shadow_under_its_groups_effects`; render `objectfx::a_shadow_before_a_skipped_transform_reaches_as_far_as_it_is_drawn`, `fx::renderer::tests::a_path_paints_from_the_transforms_that_moved_it`; engine `objexpand::a_shadow_before_a_skipped_transform_expands_with_its_own_offset`). Not yet: the shadow of type, an image, a symbol instance or a group whose art a Transform effect leaves in place past the budget still follows that effect. Scores and hours unchanged.
- **Raster effects inside an object or group with a Transform effect:** effects applied to a group affect everything in it ([Appearance attributes](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-graphic-styles/appearance-attributes-in-illustrator.html)). How a Transform effect changes the raster effects inside a group or object is VectorCraft's own rule. A group's Transform effect that moves it once now transforms the raster effects of its members, of their fills and strokes, of nested groups and of the art of the linked opacity masks in it, after the members' own Transform effects. A raster effect that a member's own Transform effect with copies or random holds back keeps its value through that effect and still transforms with the group's. VectorCraft applies the same rule to the raster effects of an object's fills and strokes under the object's Transform effect. Sizes scale by the mean scale and a Drop Shadow's offset turns, reflects and scales, with Scale Strokes & Effects on or off. Before, they kept their values, or with Scale Strokes & Effects on scaled by the mean scale with the offset unturned. A group's or object's Transform effect that makes copies or moves at random leaves them as before. The canvas, the redraw region, export, Expand Appearance, Object › Expand and Outline Stroke use the same values (effects `tests::rasterfollow`, `group::tests::a_compound_shapes_transform_turns_its_fills_shadow`; render `a_transform_scales_the_shadows_of_fills_and_members_with_the_art`; engine `objexpand::a_fills_shadow_under_the_objects_transform_expands_as_the_canvas_draws_it`, `objexpand::shadows_under_a_groups_or_an_objects_transform_expand_appearance_as_the_canvas_draws_them`, `outlinestroke::a_strokes_shadow_under_the_objects_transform_outlines_as_the_canvas_draws_it`). Scores and hours unchanged.