mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-05 21:42:59 -05:00
Match Objects: check the reference point of turned pixel-aligned art after snapping
A turned target that is pixel-aligned, holds pixel-aligned art or holds an instance of a pixel-aligned symbol is snapped to the pixel grid after the match, which could move its reference point while the command succeeded. Its reference point and matched dimensions are now checked after the snap, with or without Use Preview Bounds, and the match is refused when either moved. Only targets with a geometry effect are still moved back to their measured point, so aligned art is not pushed off the grid. The params text, docs/mcp.md and docs/target-app-parity.md state the refusal.
This commit is contained in:
1 parent
ff90087a6b
commit
e49b11ff4b
6 files changed
+117
-14
No files matched your search
@@ -27,7 +27,7 @@ use super::super::colorcmds::edit_if_changed;
|
||||
use super::super::edit::selected_roots;
|
||||
use super::super::graph::{capture_series_object_opacity, series_groups_among};
|
||||
use super::super::menucmds::whole_or;
|
||||
use super::super::object::{choice, object_bounds_transform, scaling, transform_node, transform_patterns};
|
||||
use super::super::object::{aligned_symbols, choice, object_bounds_transform, scaling, snaps_after_edit, transform_node, transform_patterns};
|
||||
use super::super::typecmd::refresh_bounds_of;
|
||||
use super::super::{CommandSpec, bad, checked_ids_or_selection, cmd, has_doc, has_multi, has_selection, number_or, switch_or};
|
||||
use crate::{EngineError, Result, Session};
|
||||
@@ -95,7 +95,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Match Objects",
|
||||
["Object", "Plug-ins", "Arrange Tools"],
|
||||
None,
|
||||
"{source?: \"key\" (the key object, select.key) | \"top\" (the frontmost selected object) | \"bottom\" (the backmost) (default: the key object when the selection has one, else \"top\"), size?: \"none\" | \"width\" (each target takes the source's width, its height following in proportion) | \"height\" (the source's height, the width following in proportion) | \"both\" (the source's width and height, each on its own) (\"none\"), rotate?: false (true: each target takes the source's bounding-box angle, measured counter-clockwise, turning the shorter way, at most 180°), stacking?: false (true: the targets go directly above the source in the stacking order, in its layer or group, in the order they had), reference?: 0..8 (the 9-point grid row by row from the top-left; 4, the center: the point of each target that stays put as it is sized and turned), scaleStrokes?: the Scale Strokes & Effects preference, patterns?: the Transform Pattern Tiles preference (at least one of size, rotate and stacking)} make the other selected objects (the top-level ones, at most 20000) match the source, which stays as it is, as one undo step (none when nothing changes). Sizes are measured and set as object.setBounds measures them (Use Preview Bounds), each in the object's own bounding-box frame, and a size that a target has no width or height to take is refused, as is a stacking match whose targets are not already directly above the source and that would move a clipping path, restack into a locked layer or group, put a target where the Layers panel can't (a blend's inputs, for one) or move Live Paint art; a turned target with a live effect that moves it keeps its measured reference point in place, and with Use Preview Bounds, for a target the match turns that carries a visible geometry or 3D effect or a live compound shape on itself or inside it, or a visible geometry or 3D effect in a placed symbol's art, the match is refused when pixel snapping would move that target's reference point or change a dimension it was asked to match; to match places, use object.align {to: \"key\"} → {source, count}",
|
||||
"{source?: \"key\" (the key object, select.key) | \"top\" (the frontmost selected object) | \"bottom\" (the backmost) (default: the key object when the selection has one, else \"top\"), size?: \"none\" | \"width\" (each target takes the source's width, its height following in proportion) | \"height\" (the source's height, the width following in proportion) | \"both\" (the source's width and height, each on its own) (\"none\"), rotate?: false (true: each target takes the source's bounding-box angle, measured counter-clockwise, turning the shorter way, at most 180°), stacking?: false (true: the targets go directly above the source in the stacking order, in its layer or group, in the order they had), reference?: 0..8 (the 9-point grid row by row from the top-left; 4, the center: the point of each target that stays put as it is sized and turned), scaleStrokes?: the Scale Strokes & Effects preference, patterns?: the Transform Pattern Tiles preference (at least one of size, rotate and stacking)} make the other selected objects (the top-level ones, at most 20000) match the source, which stays as it is, as one undo step (none when nothing changes). Sizes are measured and set as object.setBounds measures them (Use Preview Bounds), each in the object's own bounding-box frame, and a size that a target has no width or height to take is refused, as is a stacking match whose targets are not already directly above the source and that would move a clipping path, restack into a locked layer or group, put a target where the Layers panel can't (a blend's inputs, for one) or move Live Paint art; a turned target with a live effect that moves it keeps its measured reference point in place, and with Use Preview Bounds, for a target the match turns that carries a visible geometry or 3D effect or a live compound shape on itself or inside it, or a visible geometry or 3D effect in a placed symbol's art, the match is refused when pixel snapping would move that target's reference point or change a dimension it was asked to match, as it is for a turned target that is pixel-aligned or holds pixel-aligned art or an instance of a pixel-aligned symbol, with or without Use Preview Bounds; to match places, use object.align {to: \"key\"} → {source, count}",
|
||||
has_multi,
|
||||
match_objects
|
||||
),
|
||||
@@ -438,6 +438,9 @@ fn match_objects(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let mut xfs = Vec::with_capacity(targets.len());
|
||||
// Where each turned target's reference point is before the match; it stays there.
|
||||
let mut pinned: HashMap<NodeId, Point> = HashMap::new();
|
||||
// The turned targets whose reference point is checked after pixel snapping.
|
||||
let mut checked: HashMap<NodeId, Point> = HashMap::new();
|
||||
let symbols = if rotate { aligned_symbols(&s.doc()?.doc) } else { HashMap::new() };
|
||||
for &id in &targets {
|
||||
let turn = if rotate { vectorcraft_geom::normalize_deg(angle - s.doc()?.doc.bbox_angle(&[id])) } else { 0.0 };
|
||||
let Some(b) = s.transform_box(&[id]) else {
|
||||
@@ -460,12 +463,16 @@ fn match_objects(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
// Rotation uses the reference point that sizing keeps in place.
|
||||
let at = b.to_doc() * vectorcraft_geom::reference_point(b.rect, reference as usize);
|
||||
xf = Affine::rotate_about(-turn.to_radians(), at) * xf;
|
||||
if s.bounds_measure().preview && {
|
||||
let d = &s.doc()?.doc;
|
||||
d.node(id).is_some_and(|n| effects::preview::draws_geometry(&d.symbol_boxes(), n))
|
||||
} {
|
||||
let preview = s.bounds_measure().preview;
|
||||
let d = &s.doc()?.doc;
|
||||
if preview && d.node(id).is_some_and(|n| effects::preview::draws_geometry(&d.symbol_boxes(), n)) {
|
||||
pinned.insert(id, at);
|
||||
}
|
||||
// Pixel snapping after the turn can move a pixel-aligned target: its point is checked
|
||||
// too, but not put back, since that would move its aligned art off the grid.
|
||||
if pinned.contains_key(&id) || d.node(id).is_some_and(|n| snaps_after_edit(n, &symbols)) {
|
||||
checked.insert(id, at);
|
||||
}
|
||||
}
|
||||
if wanted.is_some() {
|
||||
let sc = scaling(s, &json!({ "strokes": strokes }));
|
||||
@@ -560,11 +567,13 @@ fn match_objects(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
// Targets moved out of an Intertwine group leave it as ordinary art.
|
||||
crate::cmd::intertwine::settle_members(d, &placed, &left)?;
|
||||
}
|
||||
if !pinned.is_empty() {
|
||||
crate::cmd::refresh_pixel_aligned(&before, d);
|
||||
if !checked.is_empty() {
|
||||
// Measured on a snapped copy: the edit itself snaps once, after Global Edit.
|
||||
let mut snapped = d.clone();
|
||||
crate::cmd::refresh_pixel_aligned(&before, &mut snapped);
|
||||
for (id, _) in &xfs {
|
||||
let Some(at) = pinned.get(id) else { continue };
|
||||
let ob = effects::preview::oriented_bounds_with(d, &[*id], measure);
|
||||
let Some(at) = checked.get(id) else { continue };
|
||||
let ob = effects::preview::oriented_bounds_with(&snapped, &[*id], measure);
|
||||
let kept = ob.is_some_and(|b| (*at - b.to_doc() * vectorcraft_geom::reference_point(b.rect, reference as usize)).hypot() <= 1e-6);
|
||||
let misses = !kept
|
||||
|| ob.is_none_or(|b| match size {
|
||||
|
||||
@@ -451,6 +451,67 @@ fn match_size_and_rotation_measure_pixel_aligned_art_in_its_final_frame() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn match_rotation_refuses_when_pixel_snapping_would_move_the_reference_point() {
|
||||
for wrap in ["path", "group", "compound"] {
|
||||
let mut s = session();
|
||||
let target = rect(&mut s, 0.0, 0.0, 10.0, 11.0);
|
||||
if wrap != "compound" {
|
||||
s.execute("object.setPixelAligned", &json!({"on": true})).unwrap();
|
||||
}
|
||||
let target = match wrap {
|
||||
"group" => NodeId(s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap()),
|
||||
"compound" => NodeId(s.execute("object.compoundPath.make", &json!({})).unwrap()["id"].as_u64().unwrap()),
|
||||
_ => target,
|
||||
};
|
||||
select(&mut s, &[target]);
|
||||
if wrap == "compound" {
|
||||
s.execute("object.setPixelAligned", &json!({"on": true})).unwrap();
|
||||
}
|
||||
let source = rect(&mut s, 100.0, 0.0, 10.0, 10.0);
|
||||
select(&mut s, &[source]);
|
||||
s.execute("object.rotate", &json!({"angle": 90})).unwrap();
|
||||
select(&mut s, &[target, source]);
|
||||
s.execute("select.key", &json!({"id": source.0})).unwrap();
|
||||
let before = s.doc().unwrap().doc.clone();
|
||||
let n = steps(&s);
|
||||
// Turned a quarter about its center (5, 5.5), the 10 x 11 path's edges land on half points,
|
||||
// and snapping them back to the grid would move that center.
|
||||
let e = s.execute("addon.arrange.match", &json!({"rotate": true})).unwrap_err().to_string();
|
||||
assert!(e.contains("reference point"), "{wrap}: {e}");
|
||||
assert_eq!(steps(&s), n, "{wrap}: no undo step");
|
||||
assert!(*s.doc().unwrap().doc == *before, "{wrap}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn match_rotation_keeps_a_mixed_group_in_one_piece_or_refuses() {
|
||||
let mut s = session();
|
||||
let aligned = rect(&mut s, 0.0, 0.0, 10.0, 11.0);
|
||||
s.execute("object.setPixelAligned", &json!({"on": true})).unwrap();
|
||||
let loose = rect(&mut s, 20.0, 0.0, 10.0, 11.0);
|
||||
select(&mut s, &[aligned, loose]);
|
||||
let target = NodeId(s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap());
|
||||
let source = rect(&mut s, 100.0, 0.0, 10.0, 10.0);
|
||||
select(&mut s, &[source]);
|
||||
s.execute("object.rotate", &json!({"angle": 90})).unwrap();
|
||||
select(&mut s, &[target, source]);
|
||||
s.execute("select.key", &json!({"id": source.0})).unwrap();
|
||||
let gap = |s: &Session| {
|
||||
let (a, b) = (s.transform_box(&[aligned]).unwrap().center(), s.transform_box(&[loose]).unwrap().center());
|
||||
b - a
|
||||
};
|
||||
let before = s.doc().unwrap().doc.clone();
|
||||
match s.execute("addon.arrange.match", &json!({"rotate": true})) {
|
||||
// Turned a quarter, the members' centers keep their distance and only change direction.
|
||||
Ok(_) => assert!((gap(&s).hypot() - 20.0).abs() < 1e-6, "the members moved apart: {:?}", gap(&s)),
|
||||
Err(e) => {
|
||||
assert!(e.to_string().contains("reference point"), "{e}");
|
||||
assert!(*s.doc().unwrap().doc == *before);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn match_rotation_refuses_a_target_without_bounds_when_its_angle_differs() {
|
||||
for angle in [0, 30] {
|
||||
@@ -822,6 +883,27 @@ fn match_checks_a_pixel_aligned_symbols_measured_point_after_snapping() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn match_refuses_when_snapping_moves_a_pixel_aligned_symbol_instance_without_preview_bounds() {
|
||||
let mut s = session();
|
||||
s.prefs.use_preview_bounds = false;
|
||||
let source = rect(&mut s, 0.0, 0.0, 40.0, 20.0);
|
||||
let art = rect(&mut s, 100.0, 100.0, 40.0, 20.0);
|
||||
select(&mut s, &[art]);
|
||||
let target = NodeId(s.execute("symbol.new", &json!({"name": "Aligned", "alignToPixelGrid": true})).unwrap()["id"].as_u64().unwrap());
|
||||
s.execute("object.rotate", &json!({"angle": 30})).unwrap();
|
||||
s.execute("object.move", &json!({"dx": 0.25})).unwrap();
|
||||
select(&mut s, &[source, target]);
|
||||
s.execute("select.key", &json!({"id": source.0})).unwrap();
|
||||
let before = s.doc().unwrap().doc.clone();
|
||||
let n = steps(&s);
|
||||
// Turned back to its natural angle, the instance snaps to whole points, which moves its center.
|
||||
let error = s.execute("addon.arrange.match", &json!({"rotate": true})).unwrap_err().to_string();
|
||||
assert!(error.contains("can't keep its size and reference point as it turns"), "{error}");
|
||||
assert_eq!(steps(&s), n);
|
||||
assert!(*s.doc().unwrap().doc == *before);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn match_turns_art_with_a_moving_fill_effect_about_its_measured_point() {
|
||||
for grouped in [false, true] {
|
||||
|
||||
@@ -37,8 +37,8 @@ pub(crate) use bounds::{bounds_rewrite, object_bounds_transform};
|
||||
pub use commands::specs;
|
||||
pub(super) use compound::{as_clipping_path, make_clipping_path, release_clip};
|
||||
pub(crate) use pixelgrid::{
|
||||
align_new_object, can_align, keep_aligned_in, keep_compound_aligned, keep_pixel_aligned, refresh as refresh_pixel_aligned, resnap,
|
||||
snap_if_aligned, snap_symbol_art,
|
||||
align_new_object, aligned_symbols, can_align, keep_aligned_in, keep_compound_aligned, keep_pixel_aligned, refresh as refresh_pixel_aligned,
|
||||
resnap, snap_if_aligned, snap_symbol_art, snaps_after_edit,
|
||||
};
|
||||
pub(super) use shape::recut;
|
||||
pub(crate) use transform::{apply_transform, preview_copies, scaling, transform_node, transform_patterns, transforms_objects};
|
||||
|
||||
@@ -449,6 +449,18 @@ pub(crate) fn snap_if_aligned(n: &mut Node) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether the pixel-grid snap after an edit ([`refresh`]) can move object `n`: `n` holds
|
||||
/// pixel-aligned art ([`holds_aligned`]) or an instance of a symbol in `symbols`, the document's
|
||||
/// pixel-aligned symbols ([`aligned_symbols`]).
|
||||
pub(crate) fn snaps_after_edit(n: &Node, symbols: &HashMap<String, Affine>) -> bool {
|
||||
holds_aligned(n) || !symbols.is_empty() && holds_instance(n, symbols)
|
||||
}
|
||||
|
||||
/// The pixel-aligned symbols of `d`, keyed by name, for [`snaps_after_edit`].
|
||||
pub(crate) fn aligned_symbols(d: &Document) -> HashMap<String, Affine> {
|
||||
d.pixel_aligned_symbols().into_iter().map(|name| (name, Affine::IDENTITY)).collect()
|
||||
}
|
||||
|
||||
/// Whether `n` or an object in it, or in the art of a linked opacity mask in it, is pixel-aligned.
|
||||
/// It goes only where a transform of `n` goes: not into unlinked masks.
|
||||
fn holds_aligned(n: &Node) -> bool {
|
||||
|
||||
+1
-1
@@ -17581,7 +17581,7 @@ as `object.setBounds` measures them (Use Preview Bounds), except Arrange in Grid
|
||||
| `addon.arrange.swap` | `size` (false); `scaleStrokes` (the Scale Strokes & Effects preference) | Swaps the bounds centres of exactly two selected objects (off otherwise); with `size`, each also takes the other's width and height. |
|
||||
| `addon.arrange.replace` | `fit`: `keep`, `bounds` (the replaced object's width and height), `proportional` (fits inside them) (`keep`); `scaleStrokes`; `keep` (false) | Puts a copy of the topmost selected object centred on each of the other selected objects, in that object's place in the stacking order; the replaced objects are deleted unless `keep` (the copy then goes right above each). Needs two objects or more; the copies are selected. → `{ids}` |
|
||||
| `addon.arrange.size` | `width`, `height` pt, 0.001…1000000 (at least one); `proportional` (false: a side not given stays; true: it follows the given one in proportion); `reference` 0…8 (4, the centre); `scaleStrokes` | Gives every selected object that width and height, keeping its reference point in place (the 9-point grid row by row from the top-left). |
|
||||
| `addon.arrange.match` | `source`: `key` (the key object, `select.key`), `top` (the frontmost selected object), `bottom` (the backmost) (the key object when the selection has one, else `top`); `size`: `none`, `width` (the height follows in proportion), `height` (the width follows in proportion), `both` (`none`); `rotate` (false); `stacking` (false); `reference` 0…8 (4, the center); `scaleStrokes`; `patterns` (the Transform Pattern Tiles preference); at least one of `size`, `rotate` and `stacking` | Makes the other selected objects (at most 20000) match the source, which stays as it is. `size` gives each one the source's width, height or both, measured in each object's own bounding-box frame; `rotate` turns each one to the source's bounding-box angle; both keep each object's reference point in place. `stacking` puts the others directly above the source, in its layer or group, in the order they had. `source: "key"` without a key object, and a `size` that takes a width or a height the source or a target does not have, and a `stacking` match that would move a clipping path, are refused. When the others are already directly above the source, a `stacking` match leaves their places as they are; otherwise it is also refused when the source's layer or group is locked, when it would put a target where the Layers panel does not allow it (among a blend's inputs, for example), or when it would move art into, out of or within a Live Paint group. A turned object with a live effect that moves it keeps its measured reference point in place. With Use Preview Bounds, for an object the match turns that carries a visible geometry or 3D effect or a live compound shape on itself or on art inside it, or a visible geometry or 3D effect in the art of a symbol it places, the match is refused when pixel snapping would move that object's reference point or change a dimension it was asked to match. To match places, use `object.align {to: "key"}`. → `{source, count}` |
|
||||
| `addon.arrange.match` | `source`: `key` (the key object, `select.key`), `top` (the frontmost selected object), `bottom` (the backmost) (the key object when the selection has one, else `top`); `size`: `none`, `width` (the height follows in proportion), `height` (the width follows in proportion), `both` (`none`); `rotate` (false); `stacking` (false); `reference` 0…8 (4, the center); `scaleStrokes`; `patterns` (the Transform Pattern Tiles preference); at least one of `size`, `rotate` and `stacking` | Makes the other selected objects (at most 20000) match the source, which stays as it is. `size` gives each one the source's width, height or both, measured in each object's own bounding-box frame; `rotate` turns each one to the source's bounding-box angle; both keep each object's reference point in place. `stacking` puts the others directly above the source, in its layer or group, in the order they had. `source: "key"` without a key object, and a `size` that takes a width or a height the source or a target does not have, and a `stacking` match that would move a clipping path, are refused. When the others are already directly above the source, a `stacking` match leaves their places as they are; otherwise it is also refused when the source's layer or group is locked, when it would put a target where the Layers panel does not allow it (among a blend's inputs, for example), or when it would move art into, out of or within a Live Paint group. A turned object with a live effect that moves it keeps its measured reference point in place. With Use Preview Bounds, for an object the match turns that carries a visible geometry or 3D effect or a live compound shape on itself or on art inside it, or a visible geometry or 3D effect in the art of a symbol it places, the match is refused when pixel snapping would move that object's reference point or change a dimension it was asked to match. The same refusal applies, with or without Use Preview Bounds, to a turned object that is pixel-aligned or holds pixel-aligned art or an instance of a pixel-aligned symbol. To match places, use `object.align {to: "key"}`. → `{source, count}` |
|
||||
| `addon.arrange.groupOverlapping` | none | Groups the selected objects (at most 20000) wherever their visual bounds overlap or touch, chains included: when A overlaps B and B overlaps C, all three go in one group. Only objects in the same layer or group are grouped together; objects that overlap nothing stay as they are. Each new group goes where its frontmost member was in the stacking order, and the groups and the objects left alone stay selected; with nothing overlapping it makes no step. Needs two objects or more. → `{groups: [id…], grouped}` (how many objects went into groups) |
|
||||
| `addon.arrange.randomizeOpacity` | `min`, `max` % 0…100 (30, 100; `min` not more than `max`); `seed` whole number (0); `ids` (the selection) | Gives each selected object its own opacity (the object opacity the Transparency panel sets), picked at random and evenly from `min` to `max`; the same seed, objects and range give the same opacities. Groups take one opacity of their own; the objects inside keep theirs. A run that changes no opacity, such as `min` and `max` both at the opacity every object has, records no undo step. → `{count}` |
|
||||
| `addon.arrange.sort` | `by`, `apply`: `width`, `height`, `area` (width × height), `x` (left edge), `y` (top edge), `opacity` (%), `stacking` (stacking order from the back) (`area`, `stacking`); `order`: `ascending` (small to large), `descending` (large to small), `random` (`ascending`); `distribute` (false); `seed` whole number (0, for `random`); `scaleStrokes`; `ids` (the selection) | Sorts the selected objects (at most 20000) by `by` and gives them the values of `apply` in that order: the first gets the smallest value. Without `distribute` the objects trade the values they have; with it the values step evenly from the smallest to the largest. A width, height or area changes about each object's centre (an area in proportion), a place moves the top-left corner. Stacking order always trades places, and only among objects in the same layer or group. Needs two objects or more. → `{count}` |
|
||||
|
||||
@@ -3148,7 +3148,7 @@ dialogs, Preview and Cancel, Zoom to Selection) and `command_sweep`. Commands: `
|
||||
|
||||
## Arrange Tools add-on: Match Objects (2026-11-29)
|
||||
|
||||
A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Arrange Tools › Match Objects… makes the other top-level selected objects (at most 20000) match one of them, the source: the key object, or the top or the bottom selected object. Each can take the source's width (the height following in proportion), its height (the width following), or both, measured as `object.setBounds` measures them (Use Preview Bounds) in each object's own bounding-box frame; its bounding-box angle; and its stacking place, directly above the source in its layer or group, in the order they had (targets already there keep their places; otherwise a clipping path keeps its place, so a match that would move one is refused, as is one that would move a target into a locked layer or group, among a blend's inputs or into, out of or within a Live Paint group). Sizing and turning keep each object's reference point in place; with Use Preview Bounds, for an object the match turns that carries a visible geometry or 3D effect or a live compound shape on itself or on art inside it, or a visible geometry or 3D effect in the art of a symbol it places, the match is refused when pixel snapping would move that object's reference point or change a dimension it was asked to match. Strokes, effects and pattern tiles follow Scale Strokes & Effects and Transform Pattern Tiles. The source stays as it is, the dialog previews on the canvas, and OK is one undo step; no step when nothing changes. Places are matched with Align to Key Object (`object.align {to: "key"}`). Tests: `match_*` in `cmd::addons::arrange::tests` in `vectorcraft-engine` (each size, the key, top and bottom sources, angles about the center, stacking within and across layers, no step when matched, bad params), `real_match_keyboard_edits_preview_confirm_and_cancel` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Arrange Tools add-on.
|
||||
A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Arrange Tools › Match Objects… makes the other top-level selected objects (at most 20000) match one of them, the source: the key object, or the top or the bottom selected object. Each can take the source's width (the height following in proportion), its height (the width following), or both, measured as `object.setBounds` measures them (Use Preview Bounds) in each object's own bounding-box frame; its bounding-box angle; and its stacking place, directly above the source in its layer or group, in the order they had (targets already there keep their places; otherwise a clipping path keeps its place, so a match that would move one is refused, as is one that would move a target into a locked layer or group, among a blend's inputs or into, out of or within a Live Paint group). Sizing and turning keep each object's reference point in place; with Use Preview Bounds, for an object the match turns that carries a visible geometry or 3D effect or a live compound shape on itself or on art inside it, or a visible geometry or 3D effect in the art of a symbol it places, the match is refused when pixel snapping would move that object's reference point or change a dimension it was asked to match. The same refusal applies, with or without Use Preview Bounds, to a turned object that is pixel-aligned or holds pixel-aligned art or an instance of a pixel-aligned symbol. Strokes, effects and pattern tiles follow Scale Strokes & Effects and Transform Pattern Tiles. The source stays as it is, the dialog previews on the canvas, and OK is one undo step; no step when nothing changes. Places are matched with Align to Key Object (`object.align {to: "key"}`). Tests: `match_*` in `cmd::addons::arrange::tests` in `vectorcraft-engine` (each size, the key, top and bottom sources, angles about the center, stacking within and across layers, no step when matched, bad params), `real_match_keyboard_edits_preview_confirm_and_cancel` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Arrange Tools add-on.
|
||||
|
||||
## Arrange Tools add-on: Group Overlapping Objects (2026-11-01)
|
||||
|
||||
|
||||
Reference in new issue
Block a user