Effects: each copy of a Transform effect listed after Rasterize carries the Rasterize image

On a path or compound path, a Transform effect with copies listed after
the object's own Rasterize effect now places the one image Rasterize
makes of the art before it on the original and on each copy: copy k
through the effect's map applied k times, with its pixel grid and its
room around the art, the last copy lowest and the original on top.
Before, the Transform effect copied the art and Rasterize made one image
of all the copies on a grid square to the page.

The image is made once for every placement, also when a shadow or glow
is listed between the Rasterize and Transform effects. The canvas, the
object's bounds, Expand Appearance and PDF export use the same
placements; Expand Appearance and PDF export make a group of images that
share the one image's pixels. Copies stop where the copied art stops,
and a copy scaled to nothing is left out.
This commit is contained in:
dotCooCoo
2026-11-16 13:55:27 -08:00
parent 9c61c0b66e
commit 00f42826ef
15 changed files with 444 additions and 116 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ pub use live::{expand_live, expand_live_deep, expanded_live_group, outline_objec
pub use marks::{CROP_MARKS, crop_marks_art, has_crop_marks};
pub use pixel::{PIXEL_EFFECTS, PixelFx, PixelSpace};
pub use raster::{
RASTERIZE, RasterFx, Rasterize, color_param, follow_items, item_effects_in, outset, raster_effects, rasterize_stage, stage_map, staged_effects,
RASTERIZE, RasterFx, Rasterize, color_param, follow_items, item_effects_in, outset, raster_effects, rasterize_stage, stage_maps, staged_effects,
without_geometry,
};
pub use reshape::{
+50 -16
View File
@@ -608,21 +608,36 @@ fn transform_step(e: &Effect) -> Option<Affine> {
/// The Transform effects of `effects` that move the image of its last visible Rasterize effect
/// instead of the art it is made from: the indices of the visible Transform effects listed after
/// it that move the art, when from the first visible Transform effect after it on every visible
/// effect is a Transform effect that moves the art once (no copies, not at random). Effects apply
/// in the order they are listed, so the image is made of the art before those Transform effects
/// and moves with them, its pixel grid and room around the art included. `None` when there is no
/// such Transform effect, or the effects after the Rasterize effect hold anything else from there
/// on.
/// it that move or copy the art, when from the first visible Transform effect after it on every
/// visible effect is a Transform effect that does not move at random, and at most one of them makes
/// copies. Effects apply in the order they are listed, so the image is made of the art before those
/// Transform effects and moves with them, its pixel grid and room around the art included; each copy
/// carries the same image ([`stage_maps`]). `None` when there is no such Transform effect, or the
/// effects after the Rasterize effect hold anything else from there on.
pub fn rasterize_stage(effects: &[Effect]) -> Option<Vec<usize>> {
let r = effects.iter().rposition(|e| e.visible && e.id == RASTERIZE)?;
let first = r + 1 + effects.get(r + 1..)?.iter().position(|e| e.visible && e.id == "distort.transform")?;
let mut at = vec![];
let mut copying = false;
for (i, e) in effects.iter().enumerate().skip(first).filter(|(_, e)| e.visible) {
if e.id != "distort.transform" || transform_step(e).is_none() {
if e.id != "distort.transform" {
return None;
}
if crate::distort::transform_map(Rect::ZERO, &merged_params(&e.id, &e.params), 0).0 != Affine::IDENTITY {
let p = merged_params(&e.id, &e.params);
if !flag(&p, "objects", true) {
continue;
}
if flag(&p, "random", false) {
return None;
}
let (map, copies) = crate::distort::transform_map(Rect::ZERO, &p, 0);
if copies > 0 {
if copying {
return None;
}
copying = true;
}
if copies > 0 || map != Affine::IDENTITY {
at.push(i);
}
}
@@ -641,22 +656,41 @@ pub fn staged_effects(effects: &[Effect], at: &[usize]) -> Vec<Effect> {
out
}
/// The map the Transform effects at `at` of `effects` ([`rasterize_stage`]) move the Rasterize
/// The maps the Transform effects at `at` of `effects` ([`rasterize_stage`]) place the Rasterize
/// image by, for `staged`, the geometry the effects before them make: each one's map about its
/// reference point on the bounds of the geometry it takes, as the geometry pass applies it, the
/// last one outermost. `None` when `staged` is empty or the map is not a number.
pub fn stage_map(effects: &[Effect], at: &[usize], staged: &vectorcraft_geom::PathData) -> Option<Affine> {
/// last one outermost. A Transform effect with copies places the image once more for each copy
/// the geometry pass makes, copy `k` through its map `k` times. The maps come in the order the
/// images paint, the lowest first: the last copy lowest and the original on top, as copied objects
/// stack. `None` when `staged` is empty or a map is not a number.
pub fn stage_maps(effects: &[Effect], at: &[usize], staged: &vectorcraft_geom::PathData) -> Option<Vec<Affine>> {
let mut cur = staged.clone();
let mut b = staged.bounds()?;
let mut map = Affine::IDENTITY;
// The original's map first, then each copy's.
let mut maps = vec![Affine::IDENTITY];
for &i in at {
let e = effects.get(i)?;
let (m, _) = crate::distort::transform_map(b, &merged_params(&e.id, &e.params), 0);
map = m * map;
cur = cur.transformed(m);
let p = merged_params(&e.id, &e.params);
let (m, copies) = crate::distort::transform_map(b, &p, 0);
if copies == 0 {
maps.iter_mut().for_each(|x| *x = m * *x);
cur = cur.transformed(m);
} else {
// As many copies as the geometry pass makes: it stops early past its limits.
let next = crate::distort::transform(&cur, b, &p, 0);
let made = (next.anchor_count() / cur.anchor_count().max(1)).saturating_sub(1);
let placed = maps.clone();
let mut xf = Affine::IDENTITY;
for _ in 0..made {
xf = m * xf;
maps.extend(placed.iter().map(|x| xf * *x));
}
cur = next;
}
b = cur.bounds().unwrap_or(b);
}
map.is_finite().then_some(map)
maps.reverse();
maps.iter().all(|m| m.is_finite()).then_some(maps)
}
/// Does raster effect `id` follow the Transform effects listed after it ([`followed`])? An SVG
+64 -10
View File
@@ -129,9 +129,10 @@ fn rasterize_before_a_transform_keeps_its_options() {
assert_eq!(crate::rasterize_stage(&effects), Some(vec![1]));
}
/// The Transform effects after the last Rasterize effect move its image when, from the first of
/// them on, every visible effect is a Transform effect that moves the art once. Hidden ones, and
/// ones with Transform Objects off, leave the image where it is.
/// The Transform effects after the last Rasterize effect move or copy its image when, from the
/// first of them on, every visible effect is a Transform effect that does not move at random and at
/// most one of them makes copies. Hidden ones, and ones with Transform Objects off, leave the image
/// where it is.
#[test]
fn rasterize_following_ignores_hidden_and_objects_off() {
let rasterize = || fx(crate::RASTERIZE, json!({}));
@@ -150,9 +151,16 @@ fn rasterize_following_ignores_hidden_and_objects_off() {
// the image back.
(vec![rasterize(), roughen.clone(), shadow.clone(), scale()], Some(vec![3])),
(vec![rasterize(), scale(), roughen], None),
(vec![rasterize(), scale(), shadow], None),
(vec![rasterize(), transform(json!({"scaleH": 200, "copies": 2}))], None),
(vec![rasterize(), scale(), shadow.clone()], None),
// Each copy carries the image, even of a Transform effect that only copies in place.
(vec![rasterize(), transform(json!({"scaleH": 200, "copies": 2}))], Some(vec![1])),
(vec![rasterize(), transform(json!({"copies": 2}))], Some(vec![1])),
(vec![rasterize(), transform(json!({"moveH": 10, "copies": 2})), scale()], Some(vec![1, 2])),
(vec![rasterize(), transform(json!({"moveH": 10, "copies": 2, "objects": false}))], None),
(vec![rasterize(), transform(json!({"moveH": 10, "copies": 2})), transform(json!({"moveV": 10, "copies": 3}))], None),
(vec![rasterize(), transform(json!({"moveH": 10, "copies": 2})), shadow], None),
(vec![rasterize(), transform(json!({"scaleH": 200, "random": true}))], None),
(vec![rasterize(), transform(json!({"scaleH": 200, "copies": 2, "random": true}))], None),
// The Transform effect before the Rasterize effect moves the art.
(vec![scale(), rasterize()], None),
(vec![scale(), rasterize(), rasterize(), scale()], Some(vec![3])),
@@ -173,16 +181,62 @@ fn rasterize_following_ignores_hidden_and_objects_off() {
fn the_image_moves_by_each_transform_about_the_art_it_takes() {
let staged = shapes::rectangle(Rect::new(10.0, 10.0, 30.0, 30.0));
let effects = [fx(crate::RASTERIZE, json!({})), transform(json!({"scaleH": 200, "scaleV": 200})), transform(json!({"moveH": 5}))];
let map = crate::stage_map(&effects, &[1, 2], &staged).unwrap();
let maps = crate::stage_maps(&effects, &[1, 2], &staged).unwrap();
assert_eq!(maps.len(), 1);
// Twice the size about the center (20, 20), then 5 pt to the right.
let want = Affine::translate((5.0, 0.0)) * Affine::translate((20.0, 20.0)) * Affine::scale(2.0) * Affine::translate((-20.0, -20.0));
assert!(map.as_coeffs().iter().zip(want.as_coeffs()).all(|(a, b)| (a - b).abs() < 1e-9), "{map:?}");
assert!(same_map(maps[0], want), "{maps:?}");
// The second Transform effect turns about the center of what the first one made.
let effects = [fx(crate::RASTERIZE, json!({})), transform(json!({"moveH": 100})), transform(json!({"rotate": 90}))];
let map = crate::stage_map(&effects, &[1, 2], &staged).unwrap();
let c = map * Point::new(20.0, 20.0);
let maps = crate::stage_maps(&effects, &[1, 2], &staged).unwrap();
let c = maps[0] * Point::new(20.0, 20.0);
assert!((c.x - 120.0).abs() < 1e-9 && (c.y - 20.0).abs() < 1e-9, "{c:?}");
assert_eq!(crate::stage_map(&effects, &[1, 2], &PathData::default()), None);
assert_eq!(crate::stage_maps(&effects, &[1, 2], &PathData::default()), None);
}
/// Is `a` `b`, each coefficient within 1e-9?
fn same_map(a: Affine, b: Affine) -> bool {
a.as_coeffs().iter().zip(b.as_coeffs()).all(|(a, b)| (a - b).abs() < 1e-9)
}
/// Are `maps` `want`, in order?
fn same_maps(maps: &[Affine], want: &[Affine]) -> bool {
maps.len() == want.len() && maps.iter().zip(want).all(|(m, w)| same_map(*m, *w))
}
/// A Transform effect with copies places the image once for the original and once for each copy,
/// copy `k` through its map `k` times about the art before it, the last copy lowest and the
/// original on top. A Transform effect after it moves every placement, about the bounds of all the
/// copies.
#[test]
fn each_copy_carries_the_image() {
let staged = shapes::rectangle(Rect::new(10.0, 10.0, 30.0, 30.0));
let rasterize = fx(crate::RASTERIZE, json!({}));
let effects = [rasterize.clone(), transform(json!({"moveH": 100, "copies": 2}))];
let maps = crate::stage_maps(&effects, &[1], &staged).unwrap();
let want = [Affine::translate((200.0, 0.0)), Affine::translate((100.0, 0.0)), Affine::IDENTITY];
assert!(same_maps(&maps, &want), "{maps:?}");
// Turned 90° about the center (20, 20) each time: copy 2 turns 180°.
let effects = [rasterize.clone(), transform(json!({"rotate": 90, "copies": 2}))];
let maps = crate::stage_maps(&effects, &[1], &staged).unwrap();
let turn = |deg: f64| Affine::translate((20.0, 20.0)) * Affine::rotate(-deg.to_radians()) * Affine::translate((-20.0, -20.0));
let want = [turn(180.0), turn(90.0), Affine::IDENTITY];
assert!(same_maps(&maps, &want), "{maps:?}");
// A scale after the copies doubles every placement about the center of all three, (120, 20).
let effects = [rasterize.clone(), transform(json!({"moveH": 100, "copies": 2})), transform(json!({"scaleH": 200, "scaleV": 200}))];
let maps = crate::stage_maps(&effects, &[1, 2], &staged).unwrap();
let scale = Affine::translate((120.0, 20.0)) * Affine::scale(2.0) * Affine::translate((-120.0, -20.0));
let want = [scale * Affine::translate((200.0, 0.0)), scale * Affine::translate((100.0, 0.0)), scale];
assert!(same_maps(&maps, &want), "{maps:?}");
// A move before the copies moves the art they copy.
let effects = [rasterize.clone(), transform(json!({"moveV": 5})), transform(json!({"moveH": 100, "copies": 1}))];
let maps = crate::stage_maps(&effects, &[1, 2], &staged).unwrap();
let want = [Affine::translate((100.0, 5.0)), Affine::translate((0.0, 5.0))];
assert!(same_maps(&maps, &want), "{maps:?}");
// Copies stop where the geometry pass stops them: none past its reach of 1e9 pt.
let effects = [rasterize, transform(json!({"moveH": 1.0e7, "copies": 1000}))];
let maps = crate::stage_maps(&effects, &[1], &staged).unwrap();
assert_eq!(maps.len(), 100, "{}", maps.len());
}
/// An SVG filter keeps its options: it paints in its own user space.
+61 -30
View File
@@ -378,11 +378,12 @@ pub(crate) fn raster_pixels(d: &Document, n: &Node, below: bool, members: bool)
/// The image Object › Rasterize makes of `n` with the options of `n`'s Effect › Rasterize, when
/// that is its only visible raster effect and is its own (not a fill's or a stroke's): made of `n`
/// without that effect and without its transparency, which stays on the object. When Transform
/// effects after the Rasterize effect move its image ([`vectorcraft_render::rasterize_stage`]),
/// the image is made of the art before them and moved by them, as the canvas draws it. `None`
/// otherwise, when those Transform effects flatten the image, or when the image can't be made.
/// effects after the Rasterize effect move or copy its image ([`vectorcraft_render::rasterize_stage`]),
/// the image is made of the art before them once and placed by each of their maps, as the canvas
/// draws it: with copies, a group of the placements with the lowest first. `None` otherwise, when
/// those Transform effects flatten every placement, or when the image can't be made.
fn rasterize_effect_image(d: &mut Document, n: &Node) -> Option<Node> {
let (whole, r, map) = rasterize_effect_art(d, n)?;
let (whole, r, maps) = rasterize_effect_art(d, n)?;
let p = json!({
"ppi": r.ppi.unwrap_or(d.raster_effects_ppi),
"colorModel": r.color_model.id(),
@@ -395,33 +396,58 @@ fn rasterize_effect_image(d: &mut Document, n: &Node) -> Option<Node> {
// image's transparency would need one too; upgrade when CMYK images carry alpha.
let image = super::menucmds::rasterize_art(d, vec![whole], &p, "object.rasterize", false).ok()?;
let mut image = image.into_node(d);
if let Some(map) = map {
image.transform(map, false);
match maps.as_deref() {
None => Some(image),
Some([map]) => {
image.transform(*map, false);
Some(image)
}
Some(maps) => {
// Each placement is an object of its own on the one image's pixels.
let placed: Vec<Arc<Node>> = maps
.iter()
.map(|map| {
let mut copy = d.reid(&image);
copy.transform(*map, false);
Arc::new(copy)
})
.collect();
Some(Node::group(d.alloc_id(), placed))
}
}
Some(image)
}
/// What [`rasterize_effect_image`] makes its image of: `n`, or the art before the Transform effects
/// that move the image, without the Rasterize effect and without its transparency; that effect's
/// options; and the map those Transform effects move the image by. `None` when `n` has another
/// raster effect, when the Rasterize effect is not its own, or when those Transform effects
/// flatten the image.
fn rasterize_effect_art(d: &Document, n: &Node) -> Option<(Node, effects::Rasterize, Option<Affine>)> {
/// that move or copy the image, without the Rasterize effect and without its transparency; that
/// effect's options; and the maps those Transform effects place the image by, the lowest first,
/// without those that flatten it. `None` when `n` has another raster effect, when the Rasterize
/// effect is not its own, or when those Transform effects flatten every placement.
fn rasterize_effect_art(d: &Document, n: &Node) -> Option<(Node, effects::Rasterize, Option<Vec<Affine>>)> {
let [RasterFx::Rasterize(r)] = raster_fx(n)[..] else { return None };
let staged = vectorcraft_render::rasterize_stage(d, n);
if let Some((_, map)) = &staged
&& !(map.determinant().is_finite() && map.determinant().abs() > 1e-12)
{
return None;
}
let (stage, map) = staged.map_or((None, None), |(stage, map)| (Some(stage), Some(map)));
let (stage, maps) = match vectorcraft_render::rasterize_stage(d, n) {
Some((stage, maps)) => {
let maps: Vec<Affine> = maps.into_iter().filter(|m| places(*m)).collect();
if maps.is_empty() {
return None;
}
(Some(stage), Some(maps))
}
None => (None, None),
};
let n = stage.as_ref().unwrap_or(n);
let at = n.appearance.effects.iter().position(|e| e.visible && e.id == effects::RASTERIZE)?;
let mut whole = n.clone();
whole.appearance.effects.remove(at);
(whole.opacity, whole.blend) = (1.0, Default::default());
whole.extras_mut().mask = None;
Some((whole, r, map))
Some((whole, r, maps))
}
/// Does `map`, one of those a Rasterize image is placed by ([`vectorcraft_render::rasterize_stage`]),
/// place it? Not when it flattens it to a line or a point: the canvas draws nothing there.
fn places(map: Affine) -> bool {
let det = map.determinant();
det.is_finite() && det.abs() > 1e-12
}
/// `v` (an object without its raster effects) replaced by `image` of the object with them: the
@@ -658,27 +684,32 @@ fn walk_all(out: &mut Document, nodes: &[Arc<Node>], report: &mut FlattenReport)
.then(|| nodes.iter().map(|n| walk(out, n, report).map(Arc::new).unwrap_or_else(|| n.clone())).collect())
}
/// `n` as an image when its Rasterize image moves with the Transform effects after it
/// ([`vectorcraft_render::rasterize_stage`]): the image is made of the art before those Transform
/// effects and moved by them, as the canvas draws it, which baking the geometry effects first would
/// lose. A map that flattens the image leaves an empty group, as the canvas draws nothing. Inside
/// groups, layers and opacity masks, the members are looked at the same way. `None` when nothing in
/// `n` changes; hidden objects and template layers stay as they are.
/// `n` as an image when its Rasterize image moves with the Transform effects after it, or as a
/// group of that image's placements when they copy it ([`vectorcraft_render::rasterize_stage`]):
/// the image is made of the art before those Transform effects and placed by them, as the canvas
/// draws it, which baking the geometry effects first would lose. Maps that flatten every placement
/// leave an empty group, as the canvas draws nothing. Inside groups, layers and opacity masks, the
/// members are looked at the same way. `None` when nothing in `n` changes; hidden objects and
/// template layers stay as they are.
fn staged(out: &mut Document, n: &Node, report: &mut FlattenReport) -> Option<Node> {
if !n.visible || matches!(n.kind, NodeKind::Layer { template: true, .. }) {
return None;
}
if let Some((_, map)) = vectorcraft_render::rasterize_stage(out, n) {
if let Some((_, maps)) = vectorcraft_render::rasterize_stage(out, n) {
let mut v = n.clone();
strip_raster(&mut v, false);
let det = map.determinant();
if !(det.is_finite() && det.abs() > 1e-12) {
if !maps.iter().any(|m| places(*m)) {
v.appearance = Default::default();
v.kind = NodeKind::Group { children: vec![], clip: false };
return Some(v);
}
let image = raster_image(out, n, false, false)?;
report.record(n, &image);
// The placements share one image: its resolution is the first one's.
let first = match &image.kind {
NodeKind::Group { children, clip: false } => children.first().map_or(&image, |c| &**c),
_ => &image,
};
report.record(n, first);
let mut m = replace_with_image(v, image);
staged_mask(out, &mut m, report);
return Some(m);
+50
View File
@@ -395,6 +395,56 @@ fn expand_rasterize_then_transform_matches_canvas() {
assert!(matches!(&n.kind, vectorcraft_doc::NodeKind::Group { children, .. } if children.is_empty()), "{:?}", n.kind);
}
/// With copies, the Transform effect after Rasterize places the one image on the original and on
/// each copy: Expand Appearance and PDF export make a group of the image placed by each copy's
/// map, the last copy lowest and the original on top, as the canvas draws it, all on the pixels
/// Object › Rasterize makes of the art.
#[test]
fn expand_rasterize_then_copying_transform_places_the_image_on_each_copy() {
let mut o = session();
red_rectangle(&mut o);
let made = id(&o.execute("object.rasterize", &json!({"ppi": 72, "background": "white", "addAround": 2})).unwrap());
let od = &o.doc().unwrap().doc;
let (w, h, xf, png, _) = rasterized(od, od.node(made).unwrap());
let about =
|m: vectorcraft_geom::Affine| vectorcraft_geom::Affine::translate((70.5, 65.25)) * m * vectorcraft_geom::Affine::translate((-70.5, -65.25));
let turn = |deg: f64| about(vectorcraft_geom::Affine::rotate(-deg.to_radians()));
let cases = [
(json!({"moveH": 50, "copies": 2}), [vectorcraft_geom::Affine::translate((100.0, 0.0)), vectorcraft_geom::Affine::translate((50.0, 0.0))]),
(json!({"rotate": 30, "copies": 2}), [turn(60.0), turn(30.0)]),
];
for (params, [lowest, middle]) in cases {
let mut s = session();
let r = red_rectangle(&mut s);
let raster = json!({"useDocumentResolution": false, "resolution": 72, "background": "white", "addAround": 2});
s.execute("effect.apply", &json!({"effect": "rasterize", "params": raster, "ids": [r.0]})).unwrap();
s.execute("effect.apply", &json!({"effect": "distort.transform", "params": params.clone(), "ids": [r.0]})).unwrap();
let check = |d: &Document, n: &vectorcraft_doc::Node, what: &str| {
let NodeKind::Group { children, clip: false } = &n.kind else { panic!("{what} {params}: a group, {:?}", n.kind_label()) };
assert_eq!(children.len(), 3, "{what} {params}");
let mut keys = std::collections::HashSet::new();
for (c, map) in children.iter().zip([lowest, middle, vectorcraft_geom::Affine::IDENTITY]) {
let (w2, h2, xf2, png2, _) = rasterized(d, c);
assert_eq!((w2, h2), (w, h), "{what} {params}");
assert!(png2 == png, "{what} {params}: the same pixels");
let want = map * xf;
assert!(xf2.as_coeffs().iter().zip(want.as_coeffs()).all(|(a, b)| (a - b).abs() < 1e-6), "{what} {params}: {xf2:?} {want:?}");
if let NodeKind::Image(im) = &c.kind {
keys.insert(im.key.clone());
}
}
assert_eq!(keys.len(), 1, "{what} {params}: one image for the three placements");
let mut ids = std::collections::HashSet::new();
n.walk(&mut |c| assert!(ids.insert(c.id), "{what} {params}: id {:?} twice", c.id));
};
let flat = crate::flatten_raster_effects(&s.doc().unwrap().doc).unwrap();
check(&flat, &flat.layers[0].children().unwrap()[0], "PDF export");
s.execute("effect.expandAppearance", &json!({"ids": [r.0]})).unwrap();
let d = &s.doc().unwrap().doc;
check(d, d.node(r).unwrap(), "Expand Appearance");
}
}
#[test]
fn the_clipping_mask_follows_the_art_its_geometry_effects_draw() {
let clip = |s: &Session, n: NodeId| match &s.doc().unwrap().doc.node(n).unwrap().kind {
+5 -5
View File
@@ -59,11 +59,11 @@ pub fn drawn_bounds(doc: &Document, n: &Node) -> Option<Rect> {
}
/// For a path or compound path whose own Rasterize effect is followed by Transform effects that
/// move the art once ([`crate::effects::rasterize_stage`]): `n` with those Transform effects
/// hidden, which the image is made of, and the map they move the image by. The canvas draws the
/// image on its own pixel grid and moves it, and the room around the art, with the map. `None`
/// for other objects.
pub fn rasterize_stage(doc: &Document, n: &Node) -> Option<(Node, vectorcraft_geom::Affine)> {
/// move or copy the art ([`crate::effects::rasterize_stage`]): `n` with those Transform effects
/// hidden, which the image is made of, and the maps they place the image by, the lowest first
/// (one per copy, the original's last). The canvas draws the image on its own pixel grid and
/// places it, and the room around the art, through each map. `None` for other objects.
pub fn rasterize_stage(doc: &Document, n: &Node) -> Option<(Node, Vec<vectorcraft_geom::Affine>)> {
fx::rasterize_stage(doc, n)
}
+1 -1
View File
@@ -76,7 +76,7 @@ pub(crate) use bounds::{
};
#[cfg(test)]
pub(crate) use entries::Drawn;
pub(crate) use entries::{DocInputs, FxGeom, Inputs, Reads, ShadowEntry};
pub(crate) use entries::{DocInputs, FxGeom, Inputs, Kept, Reads, ShadowEntry};
pub(crate) use pixels::paint_names;
pub(crate) use predicates::{has_fx, has_object_fx};
#[cfg(test)]
+25 -18
View File
@@ -49,12 +49,13 @@ pub(crate) fn effected_path_carrying(doc: &Document, n: &Node, bp: &BezPath) ->
}
/// `n`, a path or compound path whose own Rasterize effect is followed by Transform effects that
/// move its image ([`effects::rasterize_stage`]), with those Transform effects hidden, and the map
/// they move the image by ([`effects::stage_map`]): the image is made of that node's art on its
/// own pixel grid, then drawn through the map. `None` for any other object, when the node without
/// those Transform effects is drawn through its art ([`has_object_fx`]: a Transform effect that
/// copies it, Crop Marks, a 3D effect…), and when the art before the Transform effects is empty.
pub(crate) fn rasterize_stage(doc: &Document, n: &Node) -> Option<(Node, Affine)> {
/// move or copy its image ([`effects::rasterize_stage`]), with those Transform effects hidden, and
/// the maps they place the image by, the lowest first ([`effects::stage_maps`]): the image is made
/// of that node's art on its own pixel grid, then drawn through each map. `None` for any other
/// object, when the node without those Transform effects is drawn through its art
/// ([`has_object_fx`]: Crop Marks, a 3D effect…), and when the art before the Transform effects is
/// empty.
pub(crate) fn rasterize_stage(doc: &Document, n: &Node) -> Option<(Node, Vec<Affine>)> {
if !has_fx(n) {
return None;
}
@@ -65,15 +66,21 @@ pub(crate) fn rasterize_stage(doc: &Document, n: &Node) -> Option<(Node, Affine)
return None;
}
let g = effected_path(doc, &stage, &node_bezpath(n)?);
let map = effects::stage_map(&n.appearance.effects, &at, &vectorcraft_geom::PathData::from_bezpath(&g))?;
Some((stage, map))
let maps = effects::stage_maps(&n.appearance.effects, &at, &vectorcraft_geom::PathData::from_bezpath(&g))?;
Some((stage, maps))
}
/// The box `map` ([`rasterize_stage`]) takes `b` to; `None` when it flattens it to a line or a
/// point, which leaves nothing to draw.
pub(crate) fn staged_reach(map: Affine, b: Rect) -> Option<Rect> {
/// Does `map` ([`rasterize_stage`]) place an image? Not when it flattens it to a line or a point,
/// which leaves nothing to draw.
pub(crate) fn places(map: Affine) -> bool {
let det = map.determinant();
(det.is_finite() && det.abs() > 1e-12).then(|| map.transform_rect_bbox(b))
det.is_finite() && det.abs() > 1e-12
}
/// The box the maps of [`rasterize_stage`] take `b` to, all placements together; `None` when each
/// one flattens it ([`places`]).
pub(crate) fn staged_reach(maps: &[Affine], b: Rect) -> Option<Rect> {
maps.iter().filter(|m| places(**m)).map(|m| m.transform_rect_bbox(b)).reduce(|a, r| a.union(r))
}
pub(super) fn item_effects(item: &AppearanceItem) -> &[Effect] {
@@ -103,10 +110,10 @@ pub(crate) fn visual_bounds(symbols: &SymbolBoxes, n: &Node) -> Option<Rect> {
{
return cull_bounds(symbols, &art);
}
// A Rasterize image moved by the Transform effects after it reaches as far as the map takes
// what the art before them reaches, the image included.
if let Some((stage, map)) = rasterize_stage(symbols.document(), n) {
return staged_reach(map, visual_bounds(symbols, &stage)?);
// A Rasterize image moved or copied by the Transform effects after it reaches as far as the
// maps take what the art before them reaches, the image included.
if let Some((stage, maps)) = rasterize_stage(symbols.document(), n) {
return staged_reach(&maps, visual_bounds(symbols, &stage)?);
}
let bp = node_bezpath(n)?;
let ctx = GeomContext { doc: Some(symbols.document()), ..GeomContext::of(n) };
@@ -483,8 +490,8 @@ pub(crate) fn painted_reach(symbols: &SymbolBoxes, n: &Node) -> Option<Rect> {
if let Some(art) = effects::crop_marks_art(n) {
return drawn_bounds(symbols, &art);
}
if let Some((stage, map)) = rasterize_stage(symbols.document(), n) {
return staged_reach(map, painted_reach(symbols, &stage)?);
if let Some((stage, maps)) = rasterize_stage(symbols.document(), n) {
return staged_reach(&maps, painted_reach(symbols, &stage)?);
}
let ran = ran(symbols.document(), n);
let b = drawn_bounds_ran(symbols, n, Some(&ran))?;
+12 -1
View File
@@ -31,7 +31,7 @@ pub(super) struct Content<'a> {
/// The image of the last Rasterize before a split in an effect stack ([`Renderer::raster_fx`]). It
/// is made the first time the effects after the split draw the content and drawn from here the
/// other times, so the content before the split is drawn once.
pub(super) struct Kept {
pub(crate) struct Kept {
/// Where the effects after the split take the content from: the visible area grown by how
/// far they paint.
pub(super) window: Rect,
@@ -39,6 +39,17 @@ pub(super) struct Kept {
/// [`Renderer::rasterize_image`]'s limits: the content is then drawn in that frame.
pub(super) frame: Option<(Affine, f64)>,
pub(super) image: std::cell::RefCell<Option<KeptImage>>,
/// Kept for the placements of a path's Rasterize image that the Transform effects after it
/// copy ([`Renderer::draw_staged`]): it holds only the image on its own grid
/// ([`KeptImage::Grid`]), and each placement keeps its own raster across frames.
pub(super) shared: bool,
}
impl Kept {
/// A [`Kept`] for the placements of one path's Rasterize image (`shared`).
pub(super) fn for_placements() -> Self {
Kept { window: Rect::ZERO, frame: None, image: std::cell::RefCell::new(None), shared: true }
}
}
#[derive(Clone)]
+7 -4
View File
@@ -95,7 +95,9 @@ impl Renderer {
let key = content.cache.map(|slot| (content.node as *const Node as usize, slot, f.ink));
// Made again at this zoom and rotation (after a pan), a raster cropped to the view covers a
// margin around the view too, so that later pans within the margin draw it.
let again = key.and_then(|key| self.pixel_fx.get(&key)).is_some_and(|e| e.linear == linear) && content.kept.is_none() && !f.opts.dragging;
let again = key.and_then(|key| self.pixel_fx.get(&key)).is_some_and(|e| e.linear == linear)
&& content.kept.is_none_or(|k| k.shared)
&& !f.opts.dragging;
let room = match margin {
Some(m) if !fits && again => {
let e = pan_margin((screen.width(), screen.height()), m, PIXEL_BUDGET, f64::from(crate::MAX_RASTER_SIDE));
@@ -289,7 +291,7 @@ impl Renderer {
// A raster kept for this view alone at a lower resolution than the view's is resampled to the
// view's pixels once: each frame that draws it then copies it pixel for pixel, where sampling
// it again across the whole view cost several times as much as a plain fill.
let view_raster = key.is_some() && in_view.is_some() && k < 1.0 && content.kept.is_none();
let view_raster = key.is_some() && in_view.is_some() && k < 1.0 && content.kept.is_none_or(|k| k.shared);
let (image, x0, y0, k) = match view_raster.then(|| self.resampled(f, image.clone(), (x0, y0), k, screen)).flatten() {
Some((image, x, y)) => (image, x, y, 1.0),
None => (image, x0, y0, k),
@@ -308,8 +310,9 @@ impl Renderer {
self.pixel_fx.insert(key, entry);
self.trim_fx_rasters(FX_RASTER_BUDGET);
}
// An image over the limits was drawn at a frame's resolution: its raster is kept.
match content.kept.filter(|kept| kept.image.borrow().is_none()) {
// An image over the limits was drawn at a frame's resolution: its raster is kept. The
// placements of a copied image each draw their own (`Kept::shared`).
match content.kept.filter(|kept| !kept.shared && kept.image.borrow().is_none()) {
Some(kept) => {
let place = f.view.inverse() * Affine::translate((x0, y0)) * Affine::scale(1.0 / k);
*kept.image.borrow_mut() = Some(KeptImage::Raster(image.clone(), place, failed, image_left_out));
+57 -25
View File
@@ -1,5 +1,5 @@
use super::bounds::{cull_bounds, effected_path_carrying, node_bezpath, rasterize_stage};
use super::entries::{Content, Drawn, FX_RASTER_BUDGET, FxGeom, Inputs, ItemGeom, Kept, Made, Reads, Shadow, ShadowEntry};
use super::entries::{Content, Drawn, FX_RASTER_BUDGET, FxGeom, Inputs, ItemGeom, Kept, KeptImage, Made, Reads, Shadow, ShadowEntry};
use super::predicates::{evaluates_live, is_container, rasterize_bounds, reads_outside, shifted};
use super::raster::{
DRAG_PIXEL_BUDGET, MAX_RASTERIZE, PIXEL_BUDGET, ViewCrop, content_changing, doc_raster_ppi, image_size, linear_key, pan_margin, pcolor,
@@ -10,6 +10,10 @@ use super::{
blend_mode, effects, fill_rule, peniko,
};
/// The cache slots of placement `k` of a path's Rasterize image ([`Renderer::draw_staged`]) start
/// at `k << PLACEMENT_SLOT_SHIFT`, past those of its effects and of its fills and strokes.
const PLACEMENT_SLOT_SHIFT: u32 = 20;
#[cfg(test)]
thread_local! {
/// How many silhouettes of drop shadows and outer glows renderers on this thread have drawn:
@@ -367,11 +371,11 @@ impl Renderer {
/// [`rasterize_stage`] of `n`, kept across frames when `owner` is `n` as held in its document
/// (then `true` in the third place: the stage is kept, and so are its caches).
fn rasterize_stage_of(&mut self, f: &Frame, n: &Node, owner: Option<Arc<Node>>) -> Option<(Arc<Node>, Affine, bool)> {
fn rasterize_stage_of(&mut self, f: &Frame, n: &Node, owner: Option<Arc<Node>>) -> Option<(Arc<Node>, Arc<[Affine]>, bool)> {
// Checked first: this runs for every path with effects drawn.
effects::rasterize_stage(&n.appearance.effects)?;
let Some(owner) = owner else {
return rasterize_stage(f.symbols.document(), n).map(|(stage, map)| (Arc::new(stage), map, false));
return rasterize_stage(f.symbols.document(), n).map(|(stage, maps)| (Arc::new(stage), maps.into(), false));
};
let key = Arc::as_ptr(&owner) as usize;
let stamp = self.stamp;
@@ -379,31 +383,45 @@ impl Renderer {
&& Arc::ptr_eq(&e.0, &owner)
{
e.3 = stamp;
return Some((e.1.clone(), e.2, true));
return Some((e.1.clone(), e.2.clone(), true));
}
let (stage, map) = rasterize_stage(f.symbols.document(), n)?;
let stage = Arc::new(stage);
self.fx_stages.insert(key, (owner, stage.clone(), map, stamp));
Some((stage, map, true))
let (stage, maps) = rasterize_stage(f.symbols.document(), n)?;
let (stage, maps): (Arc<Node>, Arc<[Affine]>) = (Arc::new(stage), maps.into());
self.fx_stages.insert(key, (owner, stage.clone(), maps.clone(), stamp));
Some((stage, maps, true))
}
/// Draw `stage`, the node a path's Rasterize image is made from ([`rasterize_stage`]), through
/// `map`, the Transform effects after that Rasterize effect: its art and its image, on the
/// image's own pixel grid, move with the map. A map that flattens the art leaves nothing to
/// draw. `bp` is the path's own path; with `kept`, `stage` is kept across frames and so are
/// the geometry and rasters drawn for it.
fn draw_staged(&mut self, ctx: &mut RenderContext, f: &Frame, (stage, map, kept): (Arc<Node>, Affine, bool), bp: &BezPath, rule: FillRule) {
let det = map.determinant();
if !(det.is_finite() && det.abs() > 1e-12) {
return;
/// each of `maps`, the Transform effects after that Rasterize effect, the lowest first: its art
/// and its image, on the image's own pixel grid, move with each map. A map that flattens the
/// art leaves nothing to draw. `bp` is the path's own path; with `kept`, `stage` is kept across
/// frames and so are the geometry and rasters drawn for it. With more than one map, the image
/// is made once for all of them ([`Kept::for_placements`]), and each placement keeps its own
/// rasters in its own cache slots.
fn draw_staged(
&mut self,
ctx: &mut RenderContext,
f: &Frame,
(stage, maps, kept): (Arc<Node>, Arc<[Affine]>, bool),
bp: &BezPath,
rule: FillRule,
) {
let shared = (maps.len() > 1).then(|| std::rc::Rc::new(Kept::for_placements()));
for (k, map) in maps.iter().enumerate() {
let det = map.determinant();
if !(det.is_finite() && det.abs() > 1e-12) {
continue;
}
// A pixel's size in document units through the view and the map, measured as a frame
// measures it from its view.
let px = f.px / det.abs().sqrt();
let fr = Frame { view: f.view * *map, visible: map.inverse().transform_rect_bbox(f.visible), px, output: f.output * *map, ..*f };
let outer = if kept { self.fx_owner.replace(stage.clone()) } else { self.fx_owner.take() };
self.fx_placement = shared.as_ref().map(|s| (k << PLACEMENT_SLOT_SHIFT, s.clone()));
self.draw_shape_fx(ctx, &fr, &stage, bp, rule);
self.fx_placement = None;
self.fx_owner = outer;
}
// A pixel's size in document units through the view and the map, measured as a frame
// measures it from its view.
let px = f.px / det.abs().sqrt();
let fr = Frame { view: f.view * map, visible: map.inverse().transform_rect_bbox(f.visible), px, output: f.output * map, ..*f };
let outer = if kept { self.fx_owner.replace(stage.clone()) } else { self.fx_owner.take() };
self.draw_shape_fx(ctx, &fr, &stage, bp, rule);
self.fx_owner = outer;
}
/// [`Self::draw_shape_fx`] on the effected geometry `g`, with the items' cached geometry:
@@ -435,7 +453,10 @@ impl Renderer {
let bounds = rasterize_bounds(f.symbols, n, &rfx);
// Under Rasterize the content reaches as far as its fills' and strokes' raster effects paint.
let reach = bounds.map_or(reach, |b| reach.union(b));
let content = Content { node: n, owner: None, cache: Some(0), reach, object: reach, outline: Some((g, rule)), bounds, kept: None };
// One of several placements of a path's Rasterize image ([`Self::draw_staged`]).
let placement = self.fx_placement.take();
let (slot, kept) = placement.as_ref().map_or((0, None), |(slot, kept)| (*slot, Some(&**kept)));
let content = Content { node: n, owner: None, cache: Some(slot), reach, object: reach, outline: Some((g, rule)), bounds, kept };
let mut items = items;
self.raster_fx(ctx, f, &content, &rfx, &mut |r, c, fr| r.paint_items(c, fr, paints, g, rule, &gctx, items.as_deref_mut()));
ctx.set_transform(Affine::IDENTITY);
@@ -829,7 +850,11 @@ impl Renderer {
w.inflate(o, o)
});
let frame = last_over.then_some((f.view, f.px));
let kept = (split > at).then(|| Kept { window, frame, image: std::cell::RefCell::new(None) });
// One of several placements of a path's Rasterize image ([`Self::draw_staged`])
// starts from the image on its own grid that the placements share.
let placements = content.kept.filter(|k| k.shared);
let grid = placements.and_then(|k| k.image.borrow().clone().filter(|i| matches!(i, KeptImage::Grid(..))));
let kept = (split > at).then(|| Kept { window, frame, image: std::cell::RefCell::new(grid), shared: false });
let inner = Content {
node: content.node,
owner: content.owner,
@@ -854,6 +879,13 @@ impl Renderer {
kept: content.kept.filter(|_| split == at),
};
self.raster_fx(ctx, f, &outer, after, &mut |r, c, fr| r.raster_fx(c, fr, &inner, before, paint));
// The image made on its own grid is the one the other placements draw.
if let (Some(shared), Some(kept)) = (placements, &kept)
&& shared.image.borrow().is_none()
&& let Some(grid @ KeptImage::Grid(..)) = kept.image.borrow().clone()
{
*shared.image.borrow_mut() = Some(grid);
}
return;
}
}
+10 -3
View File
@@ -57,6 +57,11 @@ type MeasuredArt = (Arc<Node>, Arc<Node>, Option<u64>);
/// raster effects resolution (its bits) with a brush library (its key).
type ThreeDArt = (std::sync::Weak<Node>, Option<((u64, u64), Option<Rect>)>);
/// A node whose Rasterize image the Transform effects after it place ([`fx::rasterize_stage`]):
/// the node, the node it draws its image from, the maps that place the image, and the frame it
/// was last drawn in.
type FxStage = (Arc<Node>, Arc<Node>, Arc<[Affine]>, u64);
/// Reusable renderer (keeps the render context, geometry and glyph caches between frames; decoded
/// images are shared by all renderers, see [`set_image_cache_budget`]).
pub struct Renderer {
@@ -126,9 +131,11 @@ pub struct Renderer {
/// Live-effect geometry per node ([`fx::FxGeom`]), keyed by `Arc` identity like `geom`.
fx_geom: PtrMap<usize, fx::FxGeom>,
/// Per node whose Rasterize image moves with the Transform effects after it, keyed by `Arc`
/// identity like `fx_geom`: the node, the node it draws its image from and the map that moves
/// the image ([`fx::rasterize_stage`]), and the frame it was last drawn in.
fx_stages: PtrMap<usize, (Arc<Node>, Arc<Node>, Affine, u64)>,
/// identity like `fx_geom` ([`FxStage`]).
fx_stages: PtrMap<usize, FxStage>,
/// While one of several placements of a path's Rasterize image is drawn: the first cache slot
/// of that placement's rasters and where the image is kept for all of them ([`fx::Kept`]).
fx_placement: Option<(usize, std::rc::Rc<fx::Kept>)>,
stamp: u64,
/// Opacity folded into paint alpha for the leaf being drawn (avoids a compositing layer).
alpha: f32,
+1
View File
@@ -57,6 +57,7 @@ impl Renderer {
live_root: None,
fx_geom: PtrMap::default(),
fx_stages: PtrMap::default(),
fx_placement: None,
stamp: 0,
alpha: 1.0,
contexts: Vec::new(),
+97
View File
@@ -517,3 +517,100 @@ fn rasterize_before_a_hidden_transform_keeps_its_image() {
Arc::make_mut(&mut hidden.children_mut(Some(l)).unwrap()[0]).appearance.effects[1].visible = false;
assert!(plain.pixels == draw(&hidden, 10.0, 400).pixels);
}
/// Red triangles ([`triangle`]), one for each list of effects in `each`, the first lowest, in a
/// document whose raster effects resolution is 72 ppi.
fn stacked(each: &[Vec<(&str, Value)>]) -> Document {
let mut d = Document::new(100.0, 100.0);
d.raster_effects_ppi = 72.0;
let l = d.layers[0].id;
for (i, fx) in each.iter().enumerate() {
let mut n = Node::path(d.alloc_id(), triangle(), Appearance::basic(Paint::solid(Color::rgb(1.0, 0.0, 0.0)), Paint::None, 0.0));
n.appearance.effects = fx.iter().map(|(id, params)| Effect { id: (*id).into(), params: params.clone(), visible: true }).collect();
d.insert(Some(l), i, n).unwrap();
}
d
}
/// Each copy a Transform effect after Rasterize makes carries the image made before it: the canvas
/// draws the same pixels as one object moved once for each copy, the last copy lowest and the
/// original on top, turned with each copy's map, the pixel grid and the white room around the art
/// included. The image is made once for all of them, and the drawn bounds take in every copy.
#[test]
fn rasterize_then_copying_transform_places_the_image_on_each_copy() {
let raster = ("rasterize", hard(json!({"background": "white", "addAround": 1})));
let moved = |params: Value| vec![raster.clone(), ("distort.transform", params)];
let cases = [
(json!({"moveH": 30, "copies": 2}), [json!({"moveH": 60}), json!({"moveH": 30})]),
// Overlapping copies: the white room of the original covers the copies below it.
(json!({"rotate": 90, "copies": 2}), [json!({"rotate": 180}), json!({"rotate": 90})]),
(json!({"reflectX": true, "copies": 2}), [json!({}), json!({"reflectX": true})]),
];
for (params, [lowest, middle]) in cases {
let copied = doc(triangle(), &moved(params.clone()), 72.0);
let want = stacked(&[moved(lowest), moved(middle), vec![raster.clone()]]);
let drawn = || crate::fx::RASTERIZED.with(std::cell::Cell::get);
let before = drawn();
let r = draw(&copied, 4.0, 400);
assert_eq!(drawn() - before, 1, "{params}: one image for the three placements");
let w = draw(&want, 4.0, 400);
let off = r.pixels.iter().zip(&w.pixels).filter(|(a, b)| a.abs_diff(**b) > 2).count();
assert_eq!(off, 0, "{params}");
assert!(r.pixels.chunks(4).any(|p| p[3] > 0), "{params}");
let n = copied.layers[0].children().unwrap()[0].clone();
let b = crate::drawn_bounds(&copied, &n).unwrap();
let want_b = want.layers[0].children().unwrap().iter().filter_map(|c| crate::drawn_bounds(&want, c)).reduce(|a, b| a.union(b)).unwrap();
assert!(
[b.x0 - want_b.x0, b.y0 - want_b.y0, b.x1 - want_b.x1, b.y1 - want_b.y1].iter().all(|d| d.abs() < 1e-6),
"{params}: {b:?} {want_b:?}"
);
}
// Three placements 30 pt apart, each the 20 pt art and 1 pt of white around it: 9..91 pt.
let copied = doc(triangle(), &moved(json!({"moveH": 30, "copies": 2})), 72.0);
let n = copied.layers[0].children().unwrap()[0].clone();
let b = crate::drawn_bounds(&copied, &n).unwrap();
assert!((b.x0 - 9.0).abs() < 1e-9 && (b.x1 - 91.0).abs() < 1e-9 && (b.y0 - 9.0).abs() < 1e-9 && (b.y1 - 31.0).abs() < 1e-9, "{b:?}");
// A renderer that keeps the placements' rasters draws the next frame without making the image.
let mut renderer = Renderer::new();
let opts = RenderOptions { background: None, artboards: false, ..Default::default() };
let rotated = doc(triangle(), &moved(json!({"rotate": 90, "copies": 2})), 72.0);
let first = renderer.render(&rotated, 400, 400, Affine::scale(4.0), &opts);
let drawn = || crate::fx::RASTERIZED.with(std::cell::Cell::get);
let before = drawn();
let again = renderer.render(&rotated, 400, 400, Affine::scale(4.0), &opts);
assert_eq!(drawn() - before, 0);
assert!(first.pixels == again.pixels);
}
/// A shadow listed between Rasterize and a Transform effect with copies paints around each
/// placement of the image, as it does around one object moved once for each copy, and the image
/// is still made once for all the placements.
#[test]
fn rasterize_then_shadow_then_copying_transform_makes_the_image_once() {
let raster = ("rasterize", hard(json!({"background": "white", "addAround": 1})));
let shadow = ("stylize.dropShadow", json!({"mode": "normal", "opacity": 100, "x": 2, "y": 2, "blur": 0, "color": "#0000ff"}));
let moved = |params: Value| vec![raster.clone(), shadow.clone(), ("distort.transform", params)];
let copied = doc(triangle(), &moved(json!({"moveH": 30, "copies": 2})), 72.0);
let want = stacked(&[moved(json!({"moveH": 60})), moved(json!({"moveH": 30})), vec![raster.clone(), shadow.clone()]]);
let drawn = || crate::fx::RASTERIZED.with(std::cell::Cell::get);
let before = drawn();
let r = draw(&copied, 4.0, 400);
assert_eq!(drawn() - before, 1, "one image for the three placements");
let w = draw(&want, 4.0, 400);
let off = r.pixels.iter().zip(&w.pixels).filter(|(a, b)| a.abs_diff(**b) > 2).count();
assert_eq!(off, 0);
assert!(r.pixels.chunks(4).any(|p| p[2] > 200 && p[0] < 50 && p[3] > 200), "the shadow is drawn");
}
/// Copies that a Transform effect after Rasterize scales to nothing leave nothing to draw or
/// measure; the original, which the effect leaves where it is, is still drawn and measured.
#[test]
fn rasterize_then_copies_scaled_to_nothing_are_left_out() {
let raster = ("rasterize", hard(json!({"background": "white"})));
let d = doc(triangle(), &[raster.clone(), ("distort.transform", json!({"scaleH": 0, "copies": 3}))], 72.0);
let plain = doc(triangle(), &[raster], 72.0);
assert!(draw(&d, 10.0, 400).pixels == draw(&plain, 10.0, 400).pixels);
let bounds = |d: &Document| crate::drawn_bounds(d, &d.layers[0].children().unwrap()[0]);
assert_eq!(bounds(&d), bounds(&plain));
assert!(bounds(&d).is_some());
}
+3 -2
View File
@@ -650,10 +650,11 @@ since 2026-10-01.
- **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.
- **A fill's or stroke's raster effects on copies:** an effect can be applied to only the fill or only the stroke of an object ([the help page](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/vector-and-raster-effects.html)), and the Transform effect can make copies ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/distort-and-transform-effects-in-illustrator.html)). How the copies carry a fill's or stroke's raster effects is VectorCraft's own rule. On a path or compound path, each copy that a fill's or stroke's own Transform effect makes now carries the Drop Shadow, glow, blur, Feather or pixel filter listed before that Transform effect in the fill's or stroke's effects, drawn from that copy's fill area or stroke outline, with its sizes scaled by the copy's mean scale and a Drop Shadow's offset turned, reflected and scaled with the copy; with Transform Patterns or Scale Strokes & Effects on, the shadow is not scaled a second time. A raster effect listed after the Transform effect paints once around all the copies, and with either option on it stays on each copy as before. A Transform effect that makes copies and is listed after another of the fill's or stroke's own Transform effects with either option on gives each of its copies the raster effects listed before it the same way, except when a raster effect is listed before a Transform effect that is itself listed before it and makes copies or moves at random (see Not yet below); without either option of its own, it does so only when no raster effect is listed after it. Each copy of a path's own Transform effect that makes copies now carries the raster effects of its fills and strokes the same way, for a single fill, a single stroke, or several. Type is drawn as its outlines, so each copy that a fill's or stroke's own Transform effect makes of type carries those raster effects the same way. Before, one shadow was drawn around all the copies at the fill's or stroke's own distances. A Transform effect without copies, or with Transform Objects off, draws as before. 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_fills_or_strokes_own_transform_carries_the_shadow_before_it`, `tests::rasterfollow::each_copy_of_a_later_copying_transform_carries_the_shadow_before_it`, `tests::rasterfollow::each_copy_of_an_objects_transform_carries_its_fills_or_strokes_shadow`, `tests::rasterfollow::a_fills_shadow_after_its_own_copying_transform_paints_once_around_the_copies`, `tests::rasterfollow::row_copies_past_the_budget_each_keep_their_shadow`, `tests::rasterfollow::type_carries_its_fills_shadow_on_each_copy`; render `objectfx::each_copy_of_a_fills_or_strokes_transform_draws_its_own_shadow`; engine `objexpand::each_copys_fill_shadow_expands_as_the_canvas_draws_it`). Not yet: a fill's or stroke's raster effects on the copies of groups, images and symbol instances, and a fill or stroke whose effects list raster effects before one of its own Transform effects that make copies and another raster effect after it and before a later Transform effect that makes copies or moves at random (for example Drop Shadow, Transform, Drop Shadow, Transform, with both Transform effects making copies), which still paints its raster effects around all of the copies. 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. A fill's or stroke's own Transform effect that makes copies is covered under "A fill's or stroke's raster effects on copies". Not yet: the copies of groups 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. A fill's or stroke's own Transform effect that makes copies is covered under "A fill's or stroke's raster effects on copies". Not yet: the copies of groups still share one set of raster effects, and so does a path with an SVG filter or another effect that is neither a geometry effect nor one of those raster effects before the copying effect (a path's own Rasterize effect is covered under "Rasterize before a Transform effect that makes copies"). Scores and hours unchanged.
- **Raster effects before a Transform effect that copies type, an image or a symbol instance:** each copy that a Transform effect makes of type, an image or a symbol instance now carries the Drop Shadow, glow, blur, Feather or pixel filter listed before that effect, under the same VectorCraft rule as for paths: its sizes scale by that copy's mean scale and a Drop Shadow's offset turns, reflects and scales with the copy, while a raster effect listed after the Transform effect paints once around all the copies. Type is copied as its outlines, an image in its frame, and a symbol instance as its symbol's art. 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; type whose Transform effect only moves its copies is exported as its outlines then, rather than as type under one shadow (effects `tests::rasterfollow::each_copy_of_type_an_image_or_a_symbol_instance_carries_the_shadow_listed_before_it`, `tests::rasterfollow::baked_type_whose_transform_moves_its_copies_keeps_a_shadow_on_each`, `tests::rasterfollow::type_with_a_reshaped_fill_keeps_one_shadow_around_its_copies`; render `objectfx::each_copy_of_an_images_transform_effect_draws_its_own_shadow`, `objectfx::each_copy_of_a_symbol_instances_transform_effect_draws_its_own_shadow`; engine `objexpand::each_copys_shadow_on_type_expands_as_the_canvas_draws_it`). Not yet: type and symbol instances in perspective, type, images and symbol instances whose fill or stroke has geometry effects of its own, and objects with a linked opacity mask keep one set of raster effects around their copies. 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.
- **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`). A Transform effect that makes copies is covered under "Rasterize before a Transform effect that makes copies". Not yet: a Transform effect that 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.
- **Rasterize before a Transform effect that makes copies:** besides transforming an object, the Transform effect can repeat its transformation on a number of copies ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/distort-and-transform-effects-in-illustrator.html)). On a path or compound path, each copy that a Transform effect listed after the object's own Rasterize effect makes now carries the image that Rasterize made of the art before the Transform effect: the image is made once, and copy `k` places it through the effect's map applied `k` times, its pixel grid and its room around the art included, with the last copy lowest and the original on top. Before, the Transform effect copied the art and Rasterize made one image of all the copies on a grid square to the page. Placing the one image on each copy is VectorCraft's own rule. Copies stop where the copied art stops, a copy scaled to nothing is left out, and a Transform effect after the copying one moves every copy. A shadow or glow listed between the Rasterize effect and the Transform effect paints around each placement. The canvas, the object's bounds, Expand Appearance and PDF export draw the same placements; Expand Appearance and PDF export make a group of images that share the one image's pixels (effects `tests::rasterfollow::rasterize_following_ignores_hidden_and_objects_off`, `tests::rasterfollow::each_copy_carries_the_image`; render `rasterize::rasterize_then_copying_transform_places_the_image_on_each_copy`, `rasterize::rasterize_then_copies_scaled_to_nothing_are_left_out`, `rasterize::rasterize_then_shadow_then_copying_transform_makes_the_image_once`; engine `rastersettings::expand_rasterize_then_copying_transform_places_the_image_on_each_copy`). Not yet: two Transform effects that both make copies, and a copying Transform effect that moves at random, 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, except a path's Transform effect that makes copies (see "A fill's or stroke's raster effects on copies"). 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.
- **A group's geometry effects after its members' own:** effects applied to a group affect everything in it, and 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)). Running a group's effects after its members' own is VectorCraft's own rule. The geometry effects of a group or layer (the effects that reshape outlines, such as Distort & Transform, Offset Path and Warp) now reshape what its members draw: the geometry effects of each visible path and compound path in it and of their fills and strokes, and a nested group's own geometry and Pathfinder effects, run first, at any depth. A symbol instance's own geometry effects run after those of its symbol's members in the same way. Before, the group's effects reshaped the members' outlines and the members' own effects ran afterwards: a 100 pt square with its own 10 pt Offset Path in a group with a 50% Transform drew 70 pt wide, and it now draws 60 pt wide. Existing documents with such groups draw differently. The canvas, export, Expand Appearance and the art that Pathfinder operations and compound shapes take from such a group use the same order (effects `group::tests::a_members_own_offset_runs_before_its_groups_scale`, `group::tests::a_members_own_scale_runs_before_its_groups_offset`, `group::tests::a_member_of_a_plain_nested_group_takes_its_own_effects_first`, `group::tests::a_nested_groups_own_effects_run_before_its_groups`, `group::tests::a_nested_groups_pathfinder_runs_before_its_groups_effects`, `group::tests::a_members_fill_effects_run_before_its_groups`, `group::tests::shape_art_of_a_group_applies_its_members_effects_first`, `group::tests::a_symbol_instances_effects_run_after_its_symbols_members_own`, `group::tests::a_baked_group_applies_its_members_effects_first`, `group::tests::a_baked_group_that_keeps_its_type_applies_its_members_effects_first`, `tests::rasterfollow::a_groups_transform_applies_after_its_members_own`; engine `objexpand::a_groups_effects_after_its_members_own_expand_as_the_canvas_draws_them`). Not yet: the own geometry effects of images, symbol instances, paths with a linked opacity mask or a 3D effect, and nested groups with a 3D effect in the group still run after the group's. Scores and hours unchanged.