mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-16 14:17:14 +00:00
Effects: each copy of a fill's or stroke's Transform effect carries the raster effect listed before it
A Drop Shadow, glow, blur, Feather or pixel filter listed before a fill's or stroke's own Transform effect that makes copies is now drawn by each copy 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 no longer 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. 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. Before, one shadow was drawn around all the copies at the fill's or stroke'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. A fill or stroke whose effects list raster effects before a Transform effect that makes 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) still paints its raster effects around all of the copies.
This commit is contained in:
@@ -86,9 +86,9 @@ pub use raster::{
|
||||
without_geometry,
|
||||
};
|
||||
pub use reshape::{
|
||||
SYMBOL_ART_MAX_NODES, expand_outlined, follows_image_pixels, gives_image_shape, has_gradient_copies, has_instance_row_raster, has_item_geometry,
|
||||
has_painted_effects, has_transform_art, has_transform_copies, has_transform_options, image_paint, needs_outline, outer_effects, outline_art,
|
||||
outline_text, paint_type_piece, reshape,
|
||||
SYMBOL_ART_MAX_NODES, expand_outlined, follows_image_pixels, gives_image_shape, has_copied_row_raster, has_gradient_copies,
|
||||
has_instance_row_raster, has_item_geometry, has_painted_effects, has_transform_art, has_transform_copies, has_transform_options, image_paint,
|
||||
needs_outline, outer_effects, outline_art, outline_text, paint_type_piece, reshape,
|
||||
};
|
||||
pub use revolve::{
|
||||
CLASSIC_REVOLVE, REVOLVE, has_revolve, is_revolve, revolve_art, revolve_art_in, revolve_options, validate_revolve, validate_revolve_in,
|
||||
|
||||
+176
-25
@@ -107,11 +107,66 @@ fn reaches_appearance(e: &Effect) -> bool {
|
||||
}
|
||||
|
||||
/// Is `n` a path or compound path that its Transform effects make into art of separate objects
|
||||
/// ([`has_gradient_copies`], [`has_layered_copies`], [`has_transform_options`], [`copied_raster_at`]),
|
||||
/// or whose live-effect plug-ins paint what they return ([`has_painted_effects`])? It is drawn,
|
||||
/// baked and expanded through that art ([`reshape`]).
|
||||
/// ([`has_gradient_copies`], [`has_layered_copies`], [`has_transform_options`], [`copied_raster_at`],
|
||||
/// [`has_copied_row_raster`]), or whose live-effect plug-ins paint what they return
|
||||
/// ([`has_painted_effects`])? It is drawn, baked and expanded through that art ([`reshape`]).
|
||||
pub fn has_transform_art(n: &Node) -> bool {
|
||||
has_gradient_copies(n) || has_layered_copies(n) || has_transform_options(n) || has_painted_effects(n) || copied_raster_at(n).is_some()
|
||||
has_gradient_copies(n)
|
||||
|| has_layered_copies(n)
|
||||
|| has_transform_options(n)
|
||||
|| has_painted_effects(n)
|
||||
|| copied_raster_at(n).is_some()
|
||||
|| has_copied_row_raster(n)
|
||||
}
|
||||
|
||||
/// Is `n` a path or compound path with a fill or stroke that paints and whose raster effects are
|
||||
/// carried by copies: one whose own effects list a Transform effect that makes copies after a
|
||||
/// raster effect that follows it ([`copied_row_raster_at`]), or one with a raster effect that
|
||||
/// follows a Transform effect ([`crate::raster::follows`]) on a path whose own Transform effect makes
|
||||
/// copies ([`has_transform_copies`])? Each copy is then an object of its own carrying that fill's or
|
||||
/// stroke's raster effects, moved, turned, reflected and scaled with it ([`transform_item_leaf`],
|
||||
/// [`follow_copies`]).
|
||||
pub fn has_copied_row_raster(n: &Node) -> bool {
|
||||
if !matches!(n.kind, NodeKind::Path { guide: false, clipping: false, .. } | NodeKind::Compound { .. }) {
|
||||
return false;
|
||||
}
|
||||
// Checked first: this runs for every object drawn.
|
||||
if !n.appearance.items.iter().any(follows_row_raster) {
|
||||
return false;
|
||||
}
|
||||
n.appearance.items.iter().any(|i| crate::paints(i) && copied_row_raster_at(i.effects()).is_some()) || has_transform_copies(n)
|
||||
}
|
||||
|
||||
/// Does `item` paint and carry a visible raster effect that follows a Transform effect
|
||||
/// ([`crate::raster::follows`])?
|
||||
fn follows_row_raster(item: &AppearanceItem) -> bool {
|
||||
crate::paints(item) && item.effects().iter().any(|e| e.visible && crate::raster::follows(&e.id))
|
||||
}
|
||||
|
||||
/// Where a fill's or stroke's own effects `fx` split so that each copy of a Transform effect carries
|
||||
/// the raster effects listed before it: the index of the first visible Transform effect that makes
|
||||
/// copies (an earlier one that makes copies included) for which a visible raster effect that
|
||||
/// follows a Transform effect ([`crate::raster::follows`]) is listed before it, every other visible
|
||||
/// effect before it is a geometry effect or such a raster effect, and no Transform effect before it
|
||||
/// that makes copies or moves at random holds those raster effects back
|
||||
/// ([`crate::raster::held_back`]). `None` otherwise, and when a raster effect is listed after it
|
||||
/// and before a later Transform effect that makes copies or moves at random, which would apply to
|
||||
/// the art that raster effect paints.
|
||||
fn copied_row_raster_at(fx: &[Effect]) -> Option<usize> {
|
||||
let copying =
|
||||
|e: &Effect| e.visible && e.id == "distort.transform" && crate::distort::transform_map(Rect::ZERO, &merged_params(&e.id, &e.params), 0).1 > 0;
|
||||
// Is a visible raster effect in `rest` listed before its last Transform effect that holds back?
|
||||
let raster_held = |rest: &[Effect]| {
|
||||
rest.iter().rposition(crate::raster::holds_back).is_some_and(|k| rest[..k].iter().any(|e| e.visible && crate::is_raster(&e.id)))
|
||||
};
|
||||
(0..fx.len()).find(|&t| {
|
||||
let before = &fx[..t];
|
||||
copying(&fx[t])
|
||||
&& !raster_held(&fx[t + 1..])
|
||||
&& crate::raster::held_back(before) == 0
|
||||
&& 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))
|
||||
})
|
||||
}
|
||||
|
||||
/// Where the own effects of `n`, a path or compound path, split so that each copy of a Transform
|
||||
@@ -978,7 +1033,7 @@ fn as_art_opts(
|
||||
}
|
||||
_ => outline_art_with(symbols, paint_doc, n, symbol_art, outline, nodes, apart)?,
|
||||
};
|
||||
reshape_leaves_apart(&mut art, &fx, &n.appearance.effects, Budget::EFFECTS, apart, paint_doc);
|
||||
reshape_leaves_apart(&mut art, &fx, &n.appearance.effects, Budget::EFFECTS, (apart, has_copied_row_raster(n)), paint_doc);
|
||||
if apart {
|
||||
hoist_copies(&mut art);
|
||||
}
|
||||
@@ -1032,7 +1087,8 @@ fn copied_raster_art(doc: Option<&Document>, n: &Node, t: usize, apart: bool) ->
|
||||
Some(at) => copied_raster_art(doc, &source, at, apart),
|
||||
None => {
|
||||
let mut art = one_piece(&source);
|
||||
let carry = reshape_leaves_apart(&mut art, &geometry_effects(&source), &source.appearance.effects, Budget::EFFECTS, apart, doc);
|
||||
let rows = has_copied_row_raster(&source);
|
||||
let carry = reshape_leaves_apart(&mut art, &geometry_effects(&source), &source.appearance.effects, Budget::EFFECTS, (apart, rows), doc);
|
||||
if apart {
|
||||
hoist_copies(&mut art);
|
||||
}
|
||||
@@ -1073,7 +1129,7 @@ fn copied_raster_art(doc: Option<&Document>, n: &Node, t: usize, apart: bool) ->
|
||||
}
|
||||
}
|
||||
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, apart, doc);
|
||||
let carry = reshape_leaves_apart(&mut art, &later, &n.appearance.effects, Budget::EFFECTS, (apart, has_copied_row_raster(n)), doc);
|
||||
let mut ran = n.appearance.effects.clone();
|
||||
if carry.skipped() {
|
||||
carry.hide_skipped(&mut ran);
|
||||
@@ -1203,19 +1259,19 @@ pub(crate) fn geometry_effects(n: &Node) -> Vec<&Effect> {
|
||||
/// that live-effect plug-ins painting their pieces name are looked up in `doc`, and a deferred one
|
||||
/// is listed by its index in `owner`, the effect list `fx` was taken from ([`reshape_leaves_apart`]).
|
||||
pub(crate) fn reshape_leaves(art: &mut Node, fx: &[&Effect], owner: &[Effect], doc: Option<&Document>) {
|
||||
reshape_leaves_apart(art, fx, owner, Budget::EFFECTS, false, doc);
|
||||
reshape_leaves_apart(art, fx, owner, Budget::EFFECTS, (false, false), doc);
|
||||
}
|
||||
|
||||
/// [`reshape_leaves`], and how gradients that paint the art as a whole (a group's own fills and
|
||||
/// strokes) follow the effects ([`crate::Carry`]).
|
||||
pub(crate) fn reshape_leaves_carrying(art: &mut Node, fx: &[&Effect], owner: &[Effect], doc: Option<&Document>) -> crate::Carry {
|
||||
reshape_leaves_apart(art, fx, owner, Budget::EFFECTS, false, doc)
|
||||
reshape_leaves_apart(art, fx, owner, Budget::EFFECTS, (false, false), doc)
|
||||
}
|
||||
|
||||
/// [`reshape_leaves_carrying`] whose paths keep to `budget` together, or to what they cost.
|
||||
#[cfg(test)]
|
||||
pub(crate) fn reshape_leaves_within(art: &mut Node, fx: &[&Effect], budget: Budget, doc: Option<&Document>) -> crate::Carry {
|
||||
reshape_leaves_apart(art, fx, &[], budget, false, doc)
|
||||
reshape_leaves_apart(art, fx, &[], budget, (false, false), doc)
|
||||
}
|
||||
|
||||
/// `art`, the group of the one piece a path's copies are made from ([`outline_art_with`]), holding
|
||||
@@ -1236,7 +1292,10 @@ fn hoist_copies(art: &mut Node) {
|
||||
|
||||
/// [`reshape_leaves_carrying`] whose paths keep to `budget` together, or to what they cost; with
|
||||
/// `apart`, a Transform effect's copies of each path are objects
|
||||
/// of their own ([`copy_leaf`]) whatever paints them, as Expand Appearance makes them. A live-effect
|
||||
/// of their own ([`copy_leaf`]) whatever paints them, as Expand Appearance makes them. With `rows`,
|
||||
/// so are the copies of a path with a fill or stroke whose raster effects follow a Transform effect
|
||||
/// ([`crate::raster::follows`]), and each copy's fills and strokes carry those raster effects moved,
|
||||
/// turned, reflected and scaled with it ([`follow_copies`]). A live-effect
|
||||
/// plug-in that paints what it returns makes each path a group of its pieces ([`paint_leaf`]),
|
||||
/// whose swatches and patterns must be in `doc` (without one, pieces that name one are refused).
|
||||
/// Returns how gradients that paint the art as a whole follow the effects, and the Transform
|
||||
@@ -1247,7 +1306,14 @@ fn hoist_copies(art: &mut Node) {
|
||||
/// type and live objects in it outlined and evaluated first ([`outlined_members`]). When a mask
|
||||
/// stays as it was, or a Transform effect makes fewer copies than it asks for, art with linked
|
||||
/// masks keeps its shape under that effect.
|
||||
fn reshape_leaves_apart(art: &mut Node, fx: &[&Effect], owner: &[Effect], budget: Budget, apart: bool, doc: Option<&Document>) -> crate::Carry {
|
||||
fn reshape_leaves_apart(
|
||||
art: &mut Node,
|
||||
fx: &[&Effect],
|
||||
owner: &[Effect],
|
||||
budget: Budget,
|
||||
(apart, rows): (bool, bool),
|
||||
doc: Option<&Document>,
|
||||
) -> crate::Carry {
|
||||
let mut whole = crate::Carry::default();
|
||||
if fx.is_empty() {
|
||||
return whole;
|
||||
@@ -1284,7 +1350,7 @@ fn reshape_leaves_apart(art: &mut Node, fx: &[&Effect], owner: &[Effect], budget
|
||||
let params = merged_params(&e.id, &e.params);
|
||||
// Where a live-effect plug-in sits, which it is listed by when it is deferred.
|
||||
let effect = owner.iter().position(|x| std::ptr::eq(x, *e)).or_else(|| listed.iter().position(|x| std::ptr::eq(*x, *e)));
|
||||
let step = Step { e, params: ¶ms, bounds, seed, effect, apart, doc, wholes: &wholes, held };
|
||||
let step = Step { e, params: ¶ms, bounds, seed, effect, apart, rows, doc, wholes: &wholes, held };
|
||||
// Art with linked masks keeps its shape under an effect that a mask in it could not take
|
||||
// as the art it masks did, so no mask is left apart from its art.
|
||||
let before = masked.then(|| (art.clone(), used));
|
||||
@@ -1328,6 +1394,7 @@ struct Step<'a> {
|
||||
seed: u64,
|
||||
effect: Option<usize>,
|
||||
apart: bool,
|
||||
rows: bool,
|
||||
doc: Option<&'a Document>,
|
||||
wholes: &'a HashMap<NodeId, bool>,
|
||||
held: bool,
|
||||
@@ -1492,8 +1559,12 @@ impl Step<'_> {
|
||||
// make together; and Expand Appearance (`apart`) makes each copy an object.
|
||||
// Fills and strokes that stack paint each copy below the one before (#5920, #6316).
|
||||
// Each copy of a path with a linked mask carries the mask, moved with it.
|
||||
// With `rows`, each copy carries the raster effects of its fills and strokes,
|
||||
// following that copy's map.
|
||||
let rows = self.rows && copies > 0 && leaf.appearance.items.iter().any(follows_row_raster);
|
||||
let separate = copies > 0
|
||||
&& (self.apart
|
||||
|| rows
|
||||
|| leaf.appearance.has_unplaced_gradient()
|
||||
|| leaf.appearance.has_placed_gradient()
|
||||
|| paints_copies_apart(&leaf.appearance, rule)
|
||||
@@ -1501,9 +1572,12 @@ impl Step<'_> {
|
||||
// The copies of a path replace it by a group of them, the path included.
|
||||
let copied = |leaf: &Node| leaf.children().map_or(0, Vec::len);
|
||||
if options.reach_appearance() {
|
||||
let (made, moved) = transform_leaf(leaf, &path, map, copies, options, room, raster_map.is_some(), None);
|
||||
let (made, moved) = transform_leaf(leaf, &path, map, copies, options, room, raster_map.is_some() || rows, None);
|
||||
*used = used.minus(before).plus(made);
|
||||
took |= moved;
|
||||
if moved && rows {
|
||||
follow_copies(leaf, map, None);
|
||||
}
|
||||
if moved {
|
||||
// With Transform Objects off the path stays, and its mask takes the
|
||||
// effect's stroke and pattern changes as its own art.
|
||||
@@ -1519,6 +1593,9 @@ impl Step<'_> {
|
||||
if separate {
|
||||
let scaling = vectorcraft_doc::Scaling { keep_fit_when_flat: true, ..Default::default() };
|
||||
let made = copy_leaf(leaf, &path, m, copies, scaling, room, None);
|
||||
if rows {
|
||||
follow_copies(leaf, m, None);
|
||||
}
|
||||
*used = used.minus(before).plus(made);
|
||||
took = true;
|
||||
moved_ids.insert(leaf.id);
|
||||
@@ -1910,7 +1987,7 @@ fn transform_leaf(
|
||||
kept: Kept,
|
||||
) -> (Budget, bool) {
|
||||
let mut scaling = copy_scaling(options);
|
||||
if follows && copies == 0 {
|
||||
if follows {
|
||||
scaling.effects = options.strokes.then_some(scale_unfollowed as fn(&mut Effect, f64));
|
||||
}
|
||||
if !options.objects {
|
||||
@@ -2226,7 +2303,8 @@ fn paint_piece(
|
||||
|
||||
/// Every path and compound path under `art` (other than clipping paths) with a fill or stroke whose
|
||||
/// own Transform effect has Transform Patterns or Scale Strokes & Effects on
|
||||
/// ([`item_transform_options`]), or whose own live-effect plug-in paints what it returns
|
||||
/// ([`item_transform_options`]) or makes copies that carry the raster effects before it
|
||||
/// ([`copied_row_raster_at`]), or whose own live-effect plug-in paints what it returns
|
||||
/// ([`painted_plugin`]), made into a group of objects of its own ([`transform_item_leaf`]). The
|
||||
/// new paths keep to one [`Budget::EFFECTS`] together (or to what `art` costs, when that is more).
|
||||
/// The swatches and patterns painted pieces name must be in `doc`; without one they may name none.
|
||||
@@ -2243,9 +2321,20 @@ fn makes_piece(e: &Effect) -> bool {
|
||||
reaches_appearance(e) || painted_plugin(e).is_some()
|
||||
}
|
||||
|
||||
/// Does `item` paint and carry an effect that [`makes_piece`]?
|
||||
/// Where the fill's or stroke's own effects `fx` make its piece of a path an object of its own: the
|
||||
/// index of the first effect that [`makes_piece`], or of the Transform effect whose copies carry the
|
||||
/// raster effects before it ([`copied_row_raster_at`]), whichever is listed first.
|
||||
fn piece_at(fx: &[Effect]) -> Option<usize> {
|
||||
let copied = copied_row_raster_at(fx);
|
||||
match fx.iter().position(makes_piece) {
|
||||
Some(at) => Some(copied.map_or(at, |t| t.min(at))),
|
||||
None => copied,
|
||||
}
|
||||
}
|
||||
|
||||
/// Does `item` paint and carry an effect that makes its piece an object of its own ([`piece_at`])?
|
||||
fn item_makes_piece(item: &AppearanceItem) -> bool {
|
||||
crate::paints(item) && item.effects().iter().any(makes_piece)
|
||||
crate::paints(item) && piece_at(item.effects()).is_some()
|
||||
}
|
||||
|
||||
/// `leaf`, a path or compound path with a fill or stroke whose own Transform effect has Transform
|
||||
@@ -2255,12 +2344,17 @@ fn item_makes_piece(item: &AppearanceItem) -> bool {
|
||||
/// as [`transform_leaf`] transforms an object with that effect's map, copies and options, so the
|
||||
/// stroke's weight and dashes, the distances of the effects before the Transform effect and its
|
||||
/// pattern follow the map, and the raster effects before it that follow it take their followed
|
||||
/// values ([`follow_piece`]). The effects after it keep their values and apply to what it made
|
||||
/// values ([`follow_piece`]), on each copy the values that copy's map gives them
|
||||
/// ([`follow_copies`]). The effects after it keep their values and apply to what it made
|
||||
/// ([`keep_listed`]), and with Transform Objects off so do the effects before it. The reference box
|
||||
/// is that geometry's bounds and the seed is the leaf's id, as the renderer draws a fill's or
|
||||
/// stroke's own effects. The geometry effects after the Transform effect then
|
||||
/// stroke's own effects. A fill or stroke whose first such Transform effect makes copies that carry
|
||||
/// the raster effects before it ([`copied_row_raster_at`]) becomes a path of its own the same way,
|
||||
/// with neither option. The geometry effects after the Transform effect then
|
||||
/// apply to the transformed path and its copies as one piece ([`transform_piece`]), and its other
|
||||
/// effects stay on each of them. The other fills and strokes stay together on paths of the leaf's
|
||||
/// effects stay on each of them, except that without either option the raster effects after a
|
||||
/// Transform effect that makes copies paint once around all of them ([`lift_later_raster`]). The
|
||||
/// other fills and strokes stay together on paths of the leaf's
|
||||
/// geometry between them, with their own effects. `max` is the budget of the whole art and `used`
|
||||
/// what it has spent.
|
||||
///
|
||||
@@ -2306,7 +2400,7 @@ fn transform_item_leaf(leaf: &mut Node, max: Budget, used: &mut Budget, doc: Opt
|
||||
let later = |i: usize| (i + 1..transformed.len()).filter(|&j| transformed[j] || j == i + 1 || transformed[j - 1]).count();
|
||||
for (i, item) in original.appearance.items.iter().enumerate() {
|
||||
let fx = item.effects();
|
||||
let Some(at) = fx.iter().position(makes_piece).filter(|_| crate::paints(item)) else {
|
||||
let Some(at) = piece_at(fx).filter(|_| crate::paints(item)) else {
|
||||
plain.push(item.clone());
|
||||
continue;
|
||||
};
|
||||
@@ -2384,13 +2478,24 @@ fn transform_item_leaf(leaf: &mut Node, max: Budget, used: &mut Budget, doc: Opt
|
||||
set_geometry(&mut p, g.clone(), rule);
|
||||
let after = kept_before.len();
|
||||
let keep = |k: usize| k >= after || !options.objects;
|
||||
let (made, moved) = transform_leaf(&mut p, &g, map, copies, options, room, false, Some((&rest, &keep)));
|
||||
*used = used.plus(made);
|
||||
let from = crate::raster::held_back(before);
|
||||
if moved && !held_later {
|
||||
// Each copy carries the raster effects before the Transform effect, following that copy's
|
||||
// map, unless a Transform effect before or after it holds them back.
|
||||
let copied = copies > 0 && !held_later && from == 0;
|
||||
let (made, moved) = transform_leaf(&mut p, &g, map, copies, options, room, copied, Some((&rest, &keep)));
|
||||
*used = used.plus(made);
|
||||
if moved && copied {
|
||||
follow_copies(&mut p, map, Some(0..after));
|
||||
} else if moved && !held_later {
|
||||
follow_piece(&mut p, kept_before.get(from..).unwrap_or_default(), from, &fx[at]);
|
||||
}
|
||||
transform_piece(&mut p, (ctx.seed, i, &kept), crate::raster::held_back(&fx[..=at]), false, limit, used, doc);
|
||||
// Without Transform Patterns and Scale Strokes & Effects, the raster effects after the
|
||||
// Transform effect paint once around all the copies, as they paint around the one path of
|
||||
// every copy.
|
||||
if copies > 0 && !options.reach_appearance() {
|
||||
lift_later_raster(&mut p, after);
|
||||
}
|
||||
pieces.push(Arc::new(p));
|
||||
}
|
||||
if !plain.is_empty() {
|
||||
@@ -2835,6 +2940,52 @@ fn follow_piece(leaf: &mut Node, was: &[Effect], from: usize, t: &Effect) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Make the raster effects that follow a Transform effect ([`crate::raster::follows`]) on the fills
|
||||
/// and strokes of each copy [`copy_leaf`] made of `leaf` with map `m` follow that copy's map: the
|
||||
/// copy `k` places below the original takes the linear part of `m` `k` times
|
||||
/// ([`crate::raster::follow_contents`]), and the original, on top, keeps its effects. `range`, when
|
||||
/// given, is which of each fill's or stroke's effects follow; the others keep their values.
|
||||
fn follow_copies(leaf: &mut Node, m: Affine, range: Option<std::ops::Range<usize>>) {
|
||||
let step = m.with_translation(vectorcraft_geom::Vec2::ZERO);
|
||||
let Some(children) = leaf.children_mut() else { return };
|
||||
let mut a = Affine::IDENTITY;
|
||||
for c in children.iter_mut().rev().skip(1) {
|
||||
a *= step;
|
||||
for item in &mut Arc::make_mut(c).appearance.items {
|
||||
let fx = item.effects_mut();
|
||||
let fx = match &range {
|
||||
Some(r) => fx.get_mut(r.clone()).unwrap_or_default(),
|
||||
None => fx.as_mut_slice(),
|
||||
};
|
||||
crate::raster::follow_contents(fx, a, Affine::IDENTITY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Move the raster effects from index `after` on of the fills and strokes of the paths under `p`,
|
||||
/// a group of copies of one fill or stroke with the same effects, onto `p` itself, so they paint
|
||||
/// once around all of the copies. The other effects stay where they are.
|
||||
fn lift_later_raster(p: &mut Node, after: usize) {
|
||||
if p.children().is_none() {
|
||||
return;
|
||||
}
|
||||
let mut lifted: Option<Vec<Effect>> = None;
|
||||
for_each_leaf(p, &mut |l| {
|
||||
for item in &mut l.appearance.items {
|
||||
let fx = item.effects_mut();
|
||||
if fx.len() <= after {
|
||||
continue;
|
||||
}
|
||||
let (raster, other): (Vec<Effect>, Vec<Effect>) = fx.split_off(after).into_iter().partition(|e| crate::is_raster(&e.id));
|
||||
fx.extend(other);
|
||||
lifted.get_or_insert(raster);
|
||||
}
|
||||
});
|
||||
if let Some(raster) = lifted {
|
||||
p.appearance.effects.extend(raster);
|
||||
}
|
||||
}
|
||||
|
||||
/// The bounds of each group of type's outlines under `n` ([`outline_text`]), `n` included, in
|
||||
/// order. A group inside one of them is part of it.
|
||||
fn type_outline_bounds(n: &Node, out: &mut Vec<Option<Rect>>) {
|
||||
|
||||
@@ -816,8 +816,8 @@ fn a_groups_transform_applies_after_its_members_own() {
|
||||
}
|
||||
|
||||
/// An object's Transform effect transforms the raster effects of its fills and strokes with the
|
||||
/// art, whatever its options: drawn, drawn through the art an option makes, and baked. One that
|
||||
/// makes copies leaves them.
|
||||
/// art, whatever its options: drawn, drawn through the art an option makes, and baked. For one that
|
||||
/// makes copies, see [`each_copy_of_an_objects_transform_carries_its_fills_or_strokes_shadow`].
|
||||
#[test]
|
||||
fn an_objects_transform_moves_its_fills_shadows() {
|
||||
let cases = [
|
||||
@@ -825,7 +825,6 @@ fn an_objects_transform_moves_its_fills_shadows() {
|
||||
(json!({"scaleH": 200, "scaleV": 100, "strokes": true}), (20.0, 10.0)),
|
||||
(json!({"rotate": 90, "patterns": true}), (10.0, -10.0)),
|
||||
(json!({"rotate": 90, "strokes": true}), (10.0, -10.0)),
|
||||
(json!({"scaleH": 200, "scaleV": 200, "copies": 1}), (10.0, 10.0)),
|
||||
];
|
||||
for (params, want) in cases {
|
||||
let mut n = fill_square(40, vec![shadow(10.0, 10.0, 0.0)]);
|
||||
@@ -1216,3 +1215,152 @@ fn copies_past_the_budget_each_keep_their_shadow() {
|
||||
assert!(paths > 1 && paths < 1001, "{paths}");
|
||||
assert_eq!(shadows_in(&art).len(), paths);
|
||||
}
|
||||
|
||||
/// `n` with only its fill (or only a 4 pt blue stroke, with `stroke`), whose own effects are
|
||||
/// `effects`.
|
||||
fn one_row(mut n: Node, stroke: bool, effects: Vec<Effect>) -> Node {
|
||||
let mut item = if stroke {
|
||||
vectorcraft_doc::AppearanceItem::Stroke(vectorcraft_doc::StrokeLayer::new(Paint::solid(Color::rgb(0.0, 0.0, 1.0)), 4.0))
|
||||
} else {
|
||||
n.appearance.items.remove(0)
|
||||
};
|
||||
*item.effects_mut() = effects;
|
||||
n.appearance.items = vec![item];
|
||||
n
|
||||
}
|
||||
|
||||
/// A case of [`copying_cases`]: the params, each copy's offset and each copy's blur.
|
||||
type CopyingCase = (Value, Vec<(f64, f64)>, Vec<f64>);
|
||||
|
||||
/// The cases of a Transform effect that makes copies with a drop shadow (10, 0) and a blur of 4
|
||||
/// before it: the params, each copy's offset and each copy's blur, the last copy first.
|
||||
fn copying_cases() -> Vec<CopyingCase> {
|
||||
vec![
|
||||
(json!({"moveH": 100, "copies": 2}), vec![(10.0, 0.0), (10.0, 0.0), (10.0, 0.0)], vec![4.0, 4.0, 4.0]),
|
||||
// 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), (0.0, -10.0), (10.0, 0.0)], vec![4.0, 4.0, 4.0]),
|
||||
(json!({"reflectX": true, "moveH": 100, "copies": 1}), vec![(-10.0, 0.0), (10.0, 0.0)], vec![4.0, 4.0]),
|
||||
(json!({"scaleH": 200, "scaleV": 200, "moveH": 100, "copies": 1}), vec![(20.0, 0.0), (10.0, 0.0)], vec![8.0, 4.0]),
|
||||
// Scale Strokes & Effects does not scale the shadow a second time, nor leave it unturned.
|
||||
(
|
||||
json!({"scaleH": 200, "scaleV": 200, "rotate": 90, "moveH": 100, "copies": 1, "strokes": true}),
|
||||
vec![(0.0, -20.0), (10.0, 0.0)],
|
||||
vec![8.0, 4.0],
|
||||
),
|
||||
(
|
||||
json!({"scaleH": 200, "scaleV": 200, "rotate": 90, "moveH": 100, "copies": 1, "patterns": true}),
|
||||
vec![(0.0, -20.0), (10.0, 0.0)],
|
||||
vec![8.0, 4.0],
|
||||
),
|
||||
]
|
||||
}
|
||||
|
||||
/// Check that `n` is drawn, expanded and baked as `want.len()` paths, each with one shadow at the
|
||||
/// offset and blur `want` and `blurs` give it, the last copy first.
|
||||
fn assert_copies_carry(n: &Node, want: &[(f64, f64)], blurs: &[f64], what: &str) {
|
||||
assert!(crate::has_transform_art(n), "{what}");
|
||||
for (how, art) in
|
||||
[("drawn", crate::reshape(None, n, None).unwrap()), ("expanded", expand_outlined(None, n, None).unwrap()), ("baked", baked(n.clone()))]
|
||||
{
|
||||
assert_eq!(paths_in(&art), want.len(), "{what}: {how} {art:?}");
|
||||
let drawn = shadows_in(&art);
|
||||
assert!(near(&drawn, want), "{what}: {how} {drawn:?}");
|
||||
let b = shadow_blurs_in(&art);
|
||||
assert!(b.len() == blurs.len() && b.iter().zip(blurs).all(|(x, y)| (x - y).abs() < 1e-9), "{what}: {how} blurs {b:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// A fill's or stroke's own Transform effect that makes copies gives each copy the shadow listed
|
||||
/// before it in that fill's or stroke's effects, moved, turned, reflected and scaled with that copy,
|
||||
/// the last copy lowest: drawn, expanded and baked. The original keeps the shadow as it is.
|
||||
#[test]
|
||||
fn each_copy_of_a_fills_or_strokes_own_transform_carries_the_shadow_before_it() {
|
||||
for stroke in [false, true] {
|
||||
for (params, want, blurs) in copying_cases() {
|
||||
let n = one_row(square(95, vec![]), stroke, vec![shadow(10.0, 0.0, 4.0), transform(params.clone())]);
|
||||
assert_copies_carry(&n, &want, &blurs, &format!("stroke {stroke}: {params}"));
|
||||
}
|
||||
// A Transform effect that makes copies before the shadow: its copies make one piece, which
|
||||
// the Transform effect after the shadow copies, each copy with its own shadow.
|
||||
let effects =
|
||||
vec![transform(json!({"moveV": 100, "copies": 1})), shadow(10.0, 0.0, 4.0), transform(json!({"rotate": 90, "moveH": 200, "copies": 1}))];
|
||||
let n = one_row(square(95, vec![]), stroke, effects);
|
||||
assert!(crate::has_transform_art(&n), "stroke {stroke}");
|
||||
for (how, art) in
|
||||
[("drawn", crate::reshape(None, &n, None).unwrap()), ("expanded", expand_outlined(None, &n, None).unwrap()), ("baked", baked(n.clone()))]
|
||||
{
|
||||
let drawn = shadows_in(&art);
|
||||
assert!(near(&drawn, &[(0.0, -10.0), (10.0, 0.0)]), "stroke {stroke}: two copying Transform effects, {how} {drawn:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A fill's or stroke's shadow under its object's Transform effect that makes copies is carried by
|
||||
/// each copy, moved, turned, reflected and scaled with it: for a single fill, a single stroke, and
|
||||
/// a fill and a stroke that paint each copy below the one before. Drawn, expanded and baked.
|
||||
#[test]
|
||||
fn each_copy_of_an_objects_transform_carries_its_fills_or_strokes_shadow() {
|
||||
for (params, want, blurs) in copying_cases() {
|
||||
for stroke in [false, true] {
|
||||
let mut n = one_row(square(96, vec![]), stroke, vec![shadow(10.0, 0.0, 4.0)]);
|
||||
n.appearance.effects = vec![transform(params.clone())];
|
||||
assert_copies_carry(&n, &want, &blurs, &format!("stroke {stroke}: {params}"));
|
||||
}
|
||||
// Both a fill and a stroke: only the fill has the shadow.
|
||||
let mut n = square(97, vec![transform(params.clone())]);
|
||||
if let Some(vectorcraft_doc::AppearanceItem::Stroke(s)) = n.appearance.items.get_mut(1) {
|
||||
s.paint = Paint::solid(Color::BLACK);
|
||||
s.width = 2.0;
|
||||
}
|
||||
*n.appearance.items[0].effects_mut() = vec![shadow(10.0, 0.0, 4.0)];
|
||||
assert!(crate::has_transform_art(&n), "{params}");
|
||||
for (how, art) in
|
||||
[("drawn", crate::reshape(None, &n, None).unwrap()), ("expanded", expand_outlined(None, &n, None).unwrap()), ("baked", baked(n.clone()))]
|
||||
{
|
||||
let drawn = shadows_in(&art);
|
||||
assert!(near(&drawn, &want), "layered {params}: {how} {drawn:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A shadow listed after a fill's own Transform effect that makes copies paints once around all of
|
||||
/// them, and one listed before it on each copy. A Transform effect that makes no copies, or has
|
||||
/// Transform Objects off, draws the fill as before, without art.
|
||||
#[test]
|
||||
fn a_fills_shadow_after_its_own_copying_transform_paints_once_around_the_copies() {
|
||||
let effects = vec![shadow(10.0, 0.0, 0.0), transform(json!({"rotate": 90, "copies": 1})), shadow(0.0, 5.0, 0.0)];
|
||||
let n = one_row(square(98, vec![]), false, effects);
|
||||
for (how, art) in
|
||||
[("drawn", crate::reshape(None, &n, None).unwrap()), ("expanded", expand_outlined(None, &n, None).unwrap()), ("baked", baked(n.clone()))]
|
||||
{
|
||||
assert!(near(&shadows_in(&art), &[(0.0, 5.0), (0.0, -10.0), (10.0, 0.0)]), "{how}: {:?}", shadows_in(&art));
|
||||
assert_eq!(paths_in(&art), 2, "{how}");
|
||||
}
|
||||
for params in [json!({"rotate": 90}), json!({"rotate": 90, "copies": 1, "objects": false})] {
|
||||
let n = one_row(square(99, vec![]), false, vec![shadow(10.0, 0.0, 0.0), transform(params.clone())]);
|
||||
assert!(!crate::has_transform_art(&n), "{params}");
|
||||
assert!(!crate::has_copied_row_raster(&n), "{params}");
|
||||
}
|
||||
// A shadow between two Transform effects that make copies paints on what the second one
|
||||
// copies, so the fill is drawn as before, without art.
|
||||
let copies = transform(json!({"rotate": 90, "copies": 1}));
|
||||
let n = one_row(square(99, vec![]), false, vec![shadow(10.0, 0.0, 0.0), copies.clone(), shadow(0.0, 5.0, 0.0), copies]);
|
||||
assert!(!crate::has_copied_row_raster(&n));
|
||||
assert!(!crate::has_transform_art(&n));
|
||||
}
|
||||
|
||||
/// Copies of a fill's own Transform effect that stop at the effect budget each keep their shadow,
|
||||
/// and so do those of an object's Transform effect for its fill's shadow.
|
||||
#[test]
|
||||
fn row_copies_past_the_budget_each_keep_their_shadow() {
|
||||
let copies = transform(json!({"moveV": 50, "copies": 1000}));
|
||||
let own = one_row(path_node(100, wavy(30_000), vec![]), false, vec![shadow(1.0, 0.5, 0.0), copies.clone()]);
|
||||
let mut owner = one_row(path_node(101, wavy(30_000), vec![]), false, vec![shadow(1.0, 0.5, 0.0)]);
|
||||
owner.appearance.effects = vec![copies];
|
||||
for n in [own, owner] {
|
||||
let art = crate::reshape(None, &n, None).unwrap();
|
||||
let paths = paths_in(&art);
|
||||
assert!(paths > 1 && paths < 1001, "{paths}");
|
||||
assert_eq!(shadows_in(&art).len(), paths);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,6 +278,30 @@ fn each_copys_shadow_expands_as_the_canvas_draws_it() {
|
||||
assert_eq!(diff, 0, "{diff} pixels differ");
|
||||
}
|
||||
|
||||
/// Each copy of a fill's own Transform effect, and each copy of its object's Transform effect,
|
||||
/// draws the fill's drop shadow under itself, scaled with it, and Expand Appearance keeps those
|
||||
/// shadows: the copy (10..50 across, 90..130 down) has its own shadow 40 pt to its right.
|
||||
#[test]
|
||||
fn each_copys_fill_shadow_expands_as_the_canvas_draws_it() {
|
||||
let shadow = json!({"x": 20, "y": 0, "blur": 0, "opacity": 100, "mode": "normal", "color": "#00ff00"});
|
||||
let copies = json!({"scaleH": 200, "scaleV": 200, "moveV": 80, "copies": 1});
|
||||
for own in [true, false] {
|
||||
let mut s = session();
|
||||
run(&mut s, "shape.rectangle", json!({"x": 20, "y": 20, "width": 20, "height": 20}));
|
||||
run(&mut s, "paint.setFill", json!({"color": "#ff0000"}));
|
||||
run(&mut s, "paint.setStroke", json!({"none": true}));
|
||||
run(&mut s, "effect.apply", json!({"effect": "stylize.dropShadow", "params": shadow, "item": 0}));
|
||||
let item = if own { json!(0) } else { json!(null) };
|
||||
run(&mut s, "effect.apply", json!({"effect": "distort.transform", "params": copies, "item": item}));
|
||||
let before = render(&s);
|
||||
assert_eq!(before.pixel(80, 110), [0, 255, 0, 255], "own {own}: the copy's shadow");
|
||||
run(&mut s, "effect.expandAppearance", json!({}));
|
||||
let after = render(&s);
|
||||
let diff = differing(&before, &after, 64);
|
||||
assert_eq!(diff, 0, "own {own}: {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]
|
||||
|
||||
@@ -96,8 +96,9 @@ pub(crate) fn visual_bounds(symbols: &SymbolBoxes, n: &Node) -> Option<Rect> {
|
||||
return art.visual_bounds_with(symbols).map(|r| with_raster_reach(symbols, n, r));
|
||||
}
|
||||
// Copies that each carry the raster effects listed before their Transform effect reach as far
|
||||
// as each copy's raster effects paint, and the raster effects after it spread them all.
|
||||
if effects::outer_effects(n).len() < n.appearance.effects.len()
|
||||
// as each copy's raster effects paint, and the raster effects after it spread them all,
|
||||
// as do copies whose fills and strokes each carry their own raster effects.
|
||||
if (effects::outer_effects(n).len() < n.appearance.effects.len() || effects::has_copied_row_raster(n))
|
||||
&& let Some(art) = effects::reshape(Some(symbols.document()), n, None)
|
||||
{
|
||||
return cull_bounds(symbols, &art);
|
||||
|
||||
@@ -1242,3 +1242,42 @@ 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 fill's own Transform effect, and each copy of its object's Transform effect,
|
||||
/// draws the fill's drop shadow under itself, scaled with it: as for the object's own shadow
|
||||
/// above, the copy's green shadow is 40 pt to its right. A 4 pt stroke's own Transform effect
|
||||
/// gives each copy the shadow of its stroke: the copy's right edge (38..42 across) casts it at
|
||||
/// 78..82. The bounds reach as far as the copy's shadow.
|
||||
#[test]
|
||||
fn each_copy_of_a_fills_or_strokes_transform_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 square = |item: AppearanceItem| {
|
||||
Node::path(NodeId(0), shapes::rectangle(Rect::new(10.0, 10.0, 30.0, 30.0)), Appearance { items: vec![item], ..Default::default() })
|
||||
};
|
||||
let mut red = FillLayer::new(Paint::solid(Color::rgb(1.0, 0.0, 0.0)));
|
||||
red.effects = vec![shadow(), copies()];
|
||||
let own = square(AppearanceItem::Fill(red.clone()));
|
||||
red.effects = vec![shadow()];
|
||||
let mut owner = square(AppearanceItem::Fill(red));
|
||||
owner.appearance.effects = vec![copies()];
|
||||
for (what, n) in [("own", own), ("object's", owner)] {
|
||||
let d = doc_with(Document::new(100.0, 100.0), n);
|
||||
let img = render(&d);
|
||||
assert_eq!(img.pixel(20, 20), [255, 0, 0, 255], "{what}: the square");
|
||||
assert_eq!(img.pixel(45, 20), [0, 255, 0, 255], "{what}: the square's shadow");
|
||||
assert_eq!(img.pixel(20, 80), [255, 0, 0, 255], "{what}: the copy");
|
||||
assert_eq!(img.pixel(70, 80), [0, 255, 0, 255], "{what}: the copy's shadow, 40 pt to its right");
|
||||
assert_eq!(img.pixel(85, 80), [255, 255, 255, 255], "{what}: past the copy's shadow");
|
||||
let n = &d.layers[0].children().unwrap()[0];
|
||||
let b = crate::fx::visual_bounds(&d.symbol_boxes(), n).unwrap();
|
||||
assert!(b.x1 >= 80.0 - 1e-9, "{what}: {b:?}");
|
||||
}
|
||||
let mut blue = StrokeLayer::new(Paint::solid(Color::rgb(0.0, 0.0, 1.0)), 4.0);
|
||||
blue.effects = vec![shadow(), copies()];
|
||||
let d = doc_with(Document::new(100.0, 100.0), square(AppearanceItem::Stroke(blue)));
|
||||
let img = render(&d);
|
||||
assert_eq!(img.pixel(50, 20), [0, 255, 0, 255], "the square's stroke shadow");
|
||||
assert_eq!(img.pixel(80, 80), [0, 255, 0, 255], "the copy's stroke shadow, 40 pt to the right of its edge");
|
||||
assert_eq!(img.pixel(60, 80), [255, 255, 255, 255], "inside the copy's stroke shadow");
|
||||
}
|
||||
|
||||
@@ -634,10 +634,11 @@ 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, symbol instances and 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.
|
||||
- **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. 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. 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_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`; 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, type, 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.
|
||||
- **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.
|
||||
- **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.
|
||||
- **Warp Options (#1760):** Effect > Warp and existing Appearance effect links share the fifteen existing styles, original schematic previews, orientation choices and percent Bend/Distortion controls. Focused tests passed for real numeric entry and slider input, Preview/Cancel, immediate Enter/OK, mixed-style edits, target/slot/visibility preservation and Undo/Redo. Each applied style stays unchanged until an explicit Style choice. Original style-menu and live-preview captures were reviewed; their numeric values were supplied programmatically. Public references: [Reshaping with effects](https://helpx.adobe.com/illustrator/using/reshaping-objects-effects.html) and [Using effects](https://helpx.adobe.com/illustrator/using/effects.html). Warp geometry, optional Properties integration and remembered defaults are unchanged; no broader parity claim.
|
||||
- **Placed gradients follow the Warp effects:** under each of the fifteen Warp styles with a bend or a distortion, a gradient placed with the Gradient tool moves and scales from the object's bounds before the warp to its bounds after it, as under Free Distort; a stroke's gradient uses those bounds inflated by the stroke. This holds for an object's own Warp and for a fill's or stroke's own, on the canvas and in Object › Expand of the fill. In a group with a Warp effect, each path's and compound path's gradients follow its own bounds, a nested group's own fills and strokes follow the nested group's bounds, and the group's own fills and strokes follow the group's bounds. In the art Pathfinder and compound shapes take, a symbol instance's Warp moves the gradients of its symbol's art by the art's bounds, and a compound shape's Warp moves its gradients by the bounds of its area. A gradient fitted to the object still fits the warped outline, and a warp with no bend and no distortion leaves the gradient exactly in place. Existing documents with a Warp effect on art with a placed gradient draw differently: before, the gradient stayed where it was while the outline changed. How gradients follow the warp is VectorCraft's own rule; what the Warp effects do to the object is described in [Reshaping with effects](https://helpx.adobe.com/illustrator/using/reshaping-objects-effects.html) (effects `tests::warp_bends_when_the_warp_moves_the_outline`, `bake::tests::baked_warps_move_placed_gradients_from_the_bounds_to_the_warped_bounds`, `bake::tests::a_warp_with_no_bend_leaves_a_placed_gradient_exactly_in_place`, `bake::tests::a_fills_and_a_strokes_own_warp_move_its_placed_gradient_with_the_bounds`, `group::tests::a_groups_warp_moves_the_gradients_placed_on_its_paths_by_each_paths_bounds`, `group::tests::a_groups_warp_moves_its_own_a_nested_groups_and_a_compound_paths_gradients_by_their_bounds`, `group::tests::shape_art_moves_the_gradients_of_a_symbol_instances_art_and_a_compound_shape_with_a_warp`; render `objectfx::a_paths_gradient_moves_and_scales_with_its_warped_bounds`; engine `objexpand::a_placed_gradient_moved_by_a_warp_expands_as_the_canvas_draws_it`). Scores and hours unchanged.
|
||||
|
||||
Reference in New Issue
Block a user