diff --git a/crates/engine/src/cmd/menucmds.rs b/crates/engine/src/cmd/menucmds.rs index 379130629c..8385350b2e 100644 --- a/crates/engine/src/cmd/menucmds.rs +++ b/crates/engine/src/cmd/menucmds.rs @@ -9,7 +9,7 @@ use serde_json::{Value, json}; use vectorcraft_color::{Color, Paint}; use vectorcraft_doc::marks::{MarkStyle, TrimMarks}; use vectorcraft_doc::{Appearance, ImageObject, LiveShape, Node, NodeId, NodeKind, RasterColorModel, RasterEffectsSettings, Scaling}; -use vectorcraft_geom::{Affine, Anchor, PathData, Point, Rect, Vec2}; +use vectorcraft_geom::{Affine, Anchor, Homography, PathData, Point, Rect, Vec2}; use vectorcraft_render::AntiAlias; use vectorcraft_render::encode::{RasterExportOptions, RasterFormat}; @@ -133,7 +133,7 @@ pub fn specs() -> Vec { "Create Object Mosaic…", ["Object"], None, - "{columns=10, rows=10 (whole numbers, kept within 1..1000), width?, height? (new size in pt, 0.1..1000000; default the image's), percentages?: bool (width and height are percentages of the image's size, default 100), constrain?: \"width\"|\"height\"|null (Constrain Ratio: the mosaic keeps the image's proportions, the named side's size leads and the other side's is worked out from it, both growing or shrinking in proportion to keep the sizes within 0.1..1000000), useRatio?: bool|\"width\"|\"height\" (square tiles as drawn, spacing taken off: the count on the side named, or with true on the constrained side, columns by default, stays and the other is the count, 1..1000, whose tiles come closest to square), spacingX=0, spacingY=0 (pt between tiles), gray?: bool, deleteRaster?: bool} a group of rectangles colored by the selected image's average tile colors → {id, tiles, columns, rows}", + "{columns=10, rows=10 (whole numbers, kept within 1..1000), width?, height? (new size in pt, 0.1..1000000; default the image's), percentages?: bool (width and height are percentages of the image's size, default 100), constrain?: \"width\"|\"height\"|null (Constrain Ratio: the mosaic keeps the image's proportions, the named side's size leads and the other side's is worked out from it, both growing or shrinking in proportion to keep the sizes within 0.1..1000000), useRatio?: bool|\"width\"|\"height\" (square tiles as drawn, spacing taken off: the count on the side named, or with true on the constrained side, columns by default, stays and the other is the count, 1..1000, whose tiles come closest to square), spacingX=0, spacingY=0 (pt between tiles), gray?: bool, deleteRaster?: bool} a group of rectangles colored by the selected image's average tile colors; on an image changed by Perspective Distort or Free Distort each tile is its cell placed between the image's corners, a four-sided shape, and spacing is measured at the mean length of the image's sides → {id, tiles, columns, rows}", has_image, object_mosaic ), @@ -981,6 +981,9 @@ struct MosaicPlan { cols: u32, rows: u32, xf: Affine, + /// For a distorted image, the map from its pixels to the page that places the tiles instead of + /// `xf`. + warp: Option, tile: (f64, f64), gap: (f64, f64), gray: bool, @@ -1001,9 +1004,6 @@ fn mosaic_plan(s: &Session, p: &Value) -> Result { .ok_or_else(|| bad(C, "select an image"))?; let node = st.doc.node(id).ok_or(EngineError::NoNode(id))?; let NodeKind::Image(im) = &node.kind else { return Err(bad(C, "select an image")) }; - if node.is_distorted_image() { - return Err(super::xform::distorted_image_error(C, id)); - } if !st.doc.images.get(&im.key).is_some_and(|b| !b.bytes.is_empty()) { return Err(bad(C, "the image has no embedded pixels")); } @@ -1062,11 +1062,21 @@ fn mosaic_plan(s: &Session, p: &Value) -> Result { }; let resize = Affine::translate(b.origin().to_vec2()) * Affine::scale_non_uniform(nw / bw, nh / bh) * Affine::translate(-b.origin().to_vec2()); let xf = resize * im.xf; - // Points per image pixel along each of the image's axes (the image may be turned). - let ppx = (xf * Point::new(1.0, 0.0) - xf * Point::ZERO).hypot().max(1e-9); - let ppy = (xf * Point::new(0.0, 1.0) - xf * Point::ZERO).hypot().max(1e-9); - let (sx, sy) = (f64_or(p, "spacingX", 0.0).max(0.0), f64_or(p, "spacingY", 0.0).max(0.0)); let (iw, ih) = (im.width as f64, im.height as f64); + // A distorted image's tiles are its cells mapped between its corners, resized the same way. + let warp = node.image_map().filter(|_| node.is_distorted_image()).map(|h| Homography::from_affine(resize).then_after(&h)); + // Points per image pixel along each of the image's axes (the image may be turned). A distorted + // image's sides change length along the way: each axis takes the mean of its two sides. + let (ppx, ppy) = match &warp { + Some(h) => { + let corner = |x: f64, y: f64| h.apply(Point::new(x, y)).ok_or_else(|| super::xform::distorted_image_error(C, id)); + let [a, b, c, d] = [corner(0.0, 0.0)?, corner(iw, 0.0)?, corner(iw, ih)?, corner(0.0, ih)?]; + ((a.distance(b) + d.distance(c)) / (2.0 * iw.max(1.0)), (a.distance(d) + b.distance(c)) / (2.0 * ih.max(1.0))) + } + None => ((xf * Point::new(1.0, 0.0) - xf * Point::ZERO).hypot(), (xf * Point::new(0.0, 1.0) - xf * Point::ZERO).hypot()), + }; + let (ppx, ppy) = (ppx.max(1e-9), ppy.max(1e-9)); + let (sx, sy) = (f64_or(p, "spacingX", 0.0).max(0.0), f64_or(p, "spacingY", 0.0).max(0.0)); // Use Ratio: square tiles as drawn, spacing taken off, from the count on the kept side, // measured along the image's axes. match use_ratio { @@ -1078,7 +1088,7 @@ fn mosaic_plan(s: &Session, p: &Value) -> Result { // Spacing is in points; convert to image pixels along each axis. let gap = ((sx / ppx).min(tw * 0.9), (sy / ppy).min(th * 0.9)); let delete = switch_or(p, "deleteRaster", false, C)?; - Ok(MosaicPlan { id, im: im.as_ref().clone(), cols, rows, xf, tile: (tw, th), gap, gray, delete }) + Ok(MosaicPlan { id, im: im.as_ref().clone(), cols, rows, xf, warp, tile: (tw, th), gap, gray, delete }) } /// The tile counts (columns, rows) `object.createObjectMosaic` would use with `p`, Use Ratio @@ -1089,10 +1099,26 @@ pub fn mosaic_counts(s: &Session, p: &Value) -> Result<(u32, u32)> { fn object_mosaic(s: &mut Session, p: &Value) -> Result { const C: &str = "object.createObjectMosaic"; - let MosaicPlan { id, im, cols, rows, xf, tile: (tw, th), gap: (gx, gy), gray, delete } = mosaic_plan(s, p)?; + let MosaicPlan { id, im, cols, rows, xf, warp, tile: (tw, th), gap: (gx, gy), gray, delete } = mosaic_plan(s, p)?; let blob = s.doc()?.doc.images.get(&im.key).ok_or_else(|| bad(C, "the image has no embedded pixels"))?; let raster = vectorcraft_trace::Raster::decode(&blob.bytes).map_err(|e| bad(C, e.to_string()))?; let colors = vectorcraft_trace::mosaic(&raster, cols, rows); + // Each tile's corners on the page, its cell less the spacing, through `warp` or `xf`. + let mut quads = Vec::with_capacity(colors.len()); + for r in 0..rows { + for c in 0..cols { + let x0 = c as f64 * tw + gx / 2.0; + let y0 = r as f64 * th + gy / 2.0; + let cell = [Point::new(x0, y0), Point::new(x0 + tw - gx, y0), Point::new(x0 + tw - gx, y0 + th - gy), Point::new(x0, y0 + th - gy)]; + let mut quad = cell.map(|q| xf * q); + if let Some(h) = &warp { + for (to, q) in quad.iter_mut().zip(cell) { + *to = h.apply(q).ok_or_else(|| super::xform::distorted_image_error(C, id))?; + } + } + quads.push(quad); + } + } let (gid, n) = s.edit("Create Object Mosaic", |d, sel| { let mut tiles = vec![]; for r in 0..rows { @@ -1101,10 +1127,7 @@ fn object_mosaic(s: &mut Session, p: &Value) -> Result { if ca == 0 { continue; } - let x0 = c as f64 * tw + gx / 2.0; - let y0 = r as f64 * th + gy / 2.0; - let quad = [Point::new(x0, y0), Point::new(x0 + tw - gx, y0), Point::new(x0 + tw - gx, y0 + th - gy), Point::new(x0, y0 + th - gy)] - .map(|q| xf * q); + let quad = quads[(r * cols + c) as usize]; let color = if gray { let l = (0.299 * cr as f32 + 0.587 * cg as f32 + 0.114 * cb as f32) / 255.0; Color::rgb(l, l, l) diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index bc6b04b0dc..892fcf201f 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -4519,6 +4519,69 @@ fn object_mosaic_tiles_follow_the_image_colours() { assert!(!st.doc.layers[0].children().unwrap().iter().any(|n| matches!(n.kind, vectorcraft_doc::NodeKind::Image(_)))); } +/// On an image changed by Perspective Distort, each tile is its cell placed between the image's corners: its four +/// anchors are the cell's corners mapped as the image's pixels are, in one undo step. A new size resizes the warped +/// tiles as it resizes the image's bounds, and spacing is measured at the mean length of the image's sides. +#[test] +fn object_mosaic_tiles_of_a_distorted_image_follow_its_corners() { + use vectorcraft_geom::Point; + let mut s = session(); + let a = rect(&mut s, 0.0, 0.0, 50.0, 50.0); + s.execute("paint.setFill", &json!({"color": "#ff0000", "ids": [a.0]})).unwrap(); + s.execute("paint.setStroke", &json!({"none": true, "ids": [a.0]})).unwrap(); + let b = rect(&mut s, 50.0, 0.0, 50.0, 50.0); + s.execute("paint.setFill", &json!({"color": "#0000ff", "ids": [b.0]})).unwrap(); + s.execute("paint.setStroke", &json!({"none": true, "ids": [b.0]})).unwrap(); + s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap(); + s.execute("object.rasterize", &json!({"ppi": 72})).unwrap(); + s.execute("object.distort", &json!({"corners": [[20, 0], [80, 0], [100, 50], [0, 50]]})).unwrap(); + let image = s.doc().unwrap().selection.objects.clone(); + let node = s.doc().unwrap().doc.node(image[0]).unwrap().clone(); + assert!(node.is_distorted_image()); + let vectorcraft_doc::NodeKind::Image(im) = &node.kind else { panic!("not an image") }; + let (w, h) = (f64::from(im.width), f64::from(im.height)); + let map = node.image_map().unwrap(); + let at = |x: f64, y: f64| map.apply(Point::new(x, y)).unwrap(); + let anchors = |n: &vectorcraft_doc::Node| n.path_data().unwrap().anchors().map(|(_, _, a)| a.p).collect::>(); + let near = |got: &[Point], want: &[Point]| got.len() == want.len() && got.iter().zip(want).all(|(g, w)| g.distance(*w) < 1e-6); + let tiles_of = |s: &Session, r: &serde_json::Value| { + s.doc().unwrap().doc.node(NodeId(r["id"].as_u64().unwrap())).unwrap().children().unwrap().iter().map(|t| (**t).clone()).collect::>() + }; + let undo = s.doc().unwrap().history.undo.len(); + let r = s.execute("object.createObjectMosaic", &json!({"columns": 2, "rows": 2})).unwrap(); + assert_eq!(s.doc().unwrap().history.undo.len(), undo + 1); + let tiles = tiles_of(&s, &r); + assert_eq!(tiles.len(), 4); + for (i, t) in tiles.iter().enumerate() { + let (x0, y0) = ((i % 2) as f64 * w / 2.0, (i / 2) as f64 * h / 2.0); + let want = [at(x0, y0), at(x0 + w / 2.0, y0), at(x0 + w / 2.0, y0 + h / 2.0), at(x0, y0 + h / 2.0)]; + assert!(near(&anchors(t), &want), "tile {i}: {:?} against {want:?}", anchors(t)); + } + // The first tile starts at the image's top left corner and its right side halves the top edge; the row line is + // nearer the narrow top, as the perspective puts the image's middle row there. + assert!(anchors(&tiles[0])[0].distance(Point::new(20.0, 0.0)) < 1e-6, "{:?}", anchors(&tiles[0])); + assert!((anchors(&tiles[0])[1].x - 50.0).abs() < 1e-6, "{:?}", anchors(&tiles[0])); + assert!(anchors(&tiles[0])[2].y < 24.0, "{:?}", anchors(&tiles[0])); + let fill = |n: &vectorcraft_doc::Node| n.appearance.fill_paint(); + assert_eq!(fill(&tiles[0]), vectorcraft_color::Paint::solid(vectorcraft_color::Color::rgb(1.0, 0.0, 0.0))); + assert_eq!(fill(&tiles[1]), vectorcraft_color::Paint::solid(vectorcraft_color::Color::rgb(0.0, 0.0, 1.0))); + // Twice the width: the warped tiles stretch from the left of the image's bounds. + s.execute("edit.undo", &json!({})).unwrap(); + s.execute("select.set", &json!({ "ids": image })).unwrap(); + let r = s.execute("object.createObjectMosaic", &json!({"columns": 2, "rows": 2, "width": 200, "percentages": true})).unwrap(); + let tiles = tiles_of(&s, &r); + let stretched = |p: Point| Point::new(p.x * 2.0, p.y); + assert!(near(&anchors(&tiles[3]), &[at(w / 2.0, h / 2.0), at(w, h / 2.0), at(w, h), at(w / 2.0, h)].map(stretched)), "{:?}", anchors(&tiles[3])); + // 8 pt between columns: the image's top and bottom sides are 60 and 100 pt long, so a pixel is 80 / w pt across + // and the gap is w / 10 pixels, half of it on each side of a tile. + s.execute("edit.undo", &json!({})).unwrap(); + s.execute("select.set", &json!({ "ids": image })).unwrap(); + let r = s.execute("object.createObjectMosaic", &json!({"columns": 2, "rows": 1, "spacingX": 8})).unwrap(); + let tiles = tiles_of(&s, &r); + let g = w / 20.0; + assert!(near(&anchors(&tiles[0]), &[at(g, 0.0), at(w / 2.0 - g, 0.0), at(w / 2.0 - g, h), at(g, h)]), "{:?}", anchors(&tiles[0])); +} + /// Columns and rows that are not whole numbers (a fraction, a negative number, a string or another value) are an /// error naming the key, and no mosaic is made; 2.0 columns are two columns. #[test] diff --git a/crates/engine/src/tests/xform.rs b/crates/engine/src/tests/xform.rs index 3c9a7a84cc..fb0add5be3 100644 --- a/crates/engine/src/tests/xform.rs +++ b/crates/engine/src/tests/xform.rs @@ -1043,7 +1043,6 @@ fn distort_refuses_a_folded_image_and_crop_and_trace_refuse_a_distorted_one() { for (cmd, params) in [ ("object.cropImage", json!({})), ("imageTrace.make", json!({})), - ("object.createObjectMosaic", json!({})), ("object.mesh.create", json!({})), ( "file.place", diff --git a/docs/mcp.md b/docs/mcp.md index 8cb939c506..16b119af85 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2371,6 +2371,11 @@ side that `constrain` works out as under 0.1 pt grows to 0.1 pt, and the other s on an image more than 10000000 times wider than tall (or taller than wide), no size keeps both sides in the range, and the call is refused with `` the image's proportions leave no size with both sides between 0.1 and 1000000 pt ``. +On an image changed by Perspective Distort or Free Distort, each tile is its cell of the image's pixels placed between +the image's corners, so the tiles are four-sided shapes that follow the perspective. A new size scales the tiles from +the top left of the image's bounds, as it does for any image. The spacing and Use Ratio measure a pixel by the mean +length of the image's two sides along each axis. This is VectorCraft's own rule. + The result also gives the `columns` and `rows` the mosaic was made with, here for a 100 × 50 pt image: ```json @@ -8492,8 +8497,8 @@ can place leaves the image at the parallelogram nearest them. A file whose `imag the corners where they are records none. Image info (`image.info`) gives a distorted image's resolution at its middle, and Link Info (`links.info`) gives its scale and rotation there. -Crop Image (`object.cropImage`), Image Trace (`imageTrace.make`, `imageTrace.makeAndExpand`), Create Object Mosaic -(`object.createObjectMosaic`) and Place with Replace (`file.place` with `replace`) of anything but a text file refuse a +Crop Image (`object.cropImage`), Image Trace (`imageTrace.make`, `imageTrace.makeAndExpand`) and Place with Replace +(`file.place` with `replace`) of anything but a text file refuse a distorted image with an error that names the distortion; Place with Replace does not refuse a clipping group that holds a distorted image of a DCS file's plates. Create Gradient Mesh (`object.mesh.create`) converts the other objects it is given and lists each distorted image it leaves as it is in `skipped`, with its `id` and the error as `reason`; with diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 75efe3bf2e..1b1c086832 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1299,7 +1299,8 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - After a rotation the Scale and Reflect tools, the Scale and Reflect dialogs, `object.scale`, `object.reflect` with a named axis and the Transform and Properties panels' flips act along the selection's turned bounding box until Reset Bounding Box: the horizontal and vertical scale stretch along its own width and height, and the vertical and horizontal reflection axes are its own. The Reflect tool's default axis and its Shift steps start from the box's axes, and an axis drawn with the tool is the line drawn on the page. `basis: "page"` keeps the page's axes (VectorCraft's own rules; `bboxrotate::scale_and_reflect_follow_the_turned_box`, tools `xform::transform::tests::scale_and_reflect_drags_follow_a_turned_bounding_box`). - The Reflect tool sets an axis with two clicks: a click sets the first point (and the reference point), and a second click reflects the selection across the line through both points as one undo step; Alt/Option on the second click reflects a copy, and a drag after the first click draws the axis from it ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/reflect-or-flip-objects.html)). A dashed line runs from the first point to the pointer until the second click. VectorCraft's own rules: an Alt-click opens the dialog and sets no axis; a second click whose snapped point is within 3 screen pixels of the first point's snapped point does nothing and the axis keeps waiting; Shift does not constrain a plain second click; Escape, Enter, a changed selection, an edit made outside the tool or another tool drops the waiting axis. A double-click arrives as two clicks: its first click is the second point, so a double-click away from the first point reflects the selection, and the double-click then opens the dialog with no axis waiting (tools `xform::transform::tests::a_second_reflect_click_reflects_across_the_line_through_both_points` and the four tests after it; engine `xform::two_reflect_clicks_reflect_across_their_line_as_one_undo_step`). - Perspective Distort and Free Distort (`object.distort`) turn each warped object's bounding box as the warp turns the object at its own center, the objects inside groups, compound paths and clip groups and the art of linked opacity masks included, so the next Selection or Free Transform drag uses the tilted box; Object › Transform › Reset Bounding Box squares it again, and corners left where they are add no undo step (VectorCraft's own rule; `bboxrotate::distort_turns_an_upright_box_with_the_warp_at_its_center`, `distort_turns_each_member_and_linked_mask_by_its_own_warp`, `mirrored_and_collapsing_distorts_keep_valid_angles`, `distort_angles_undo_redo_and_reopen_together`, `xform::unchanged_distort_records_no_history`). - - Perspective Distort and Free Distort (`object.distort`) move an image's four corners exactly onto the handles when the image is distorted alone; with other objects the handles stand for the whole selection, and the image's corners follow the same warp without necessarily landing on them. The image's pixels are drawn in perspective between its corners on the canvas, in print and in every export that holds images, as a mesh of affine image pieces (DXF and WMF write the nearest parallelogram and warn, as the `.ai` writers do for an image nested 8 deep in opacity masks, symbols, live objects and pattern tiles, or in a legacy `.ai` in symbols and live objects, not counting ordinary groups and layers, and leave out an image nested deeper; HP-GL plots leave images out); the native file saves the corners; bounds, clicks, blends, the Eyedropper, Outline view, the Color Theme Picker and Weed Box and Lines follow them; Image info and Link Info measure the image at its middle; and corners that would fold the image over, fall on one line, cross the warp's horizon or lie too close together for a perspective map are refused. Crop Image, Image Trace, Create Object Mosaic, Create Gradient Mesh and Place with Replace refuse a distorted image (Place with Replace refuses only when the object it measures is the distorted image, so it does not refuse when the placed file is text or the replaced object is a DCS file's plates); Update Links and Relink put the file's pixels between its corners, with the file's clipping path drawn through them, and Embed and Unembed keep them; Rasterize makes a plain image of it. All of this is VectorCraft's own rule (doc `image_quad::tests`, `blend::tests::steps_between_distorted_images_have_corners_between_theirs`; engine `xform::distort_puts_an_images_corners_on_the_handles`, `distort_moves_an_image_and_a_path_as_one`, `distort_refuses_a_folded_image_and_crop_and_trace_refuse_a_distorted_one`, `distort_names_the_horizon_and_an_unchanged_distort_of_a_distorted_image_records_nothing`, `distort_of_a_blend_holding_an_image_is_not_refused`, `free_transform_distort_drag_on_an_image_is_one_undo_step`, `mask_on_a_distorted_image_follows_its_corners`, `a_transform_effect_moves_a_distorted_images_corners`, `a_transform_after_a_warp_moves_a_distorted_image_once`, `baked_raster_effect_pixels_replace_a_distortion`, `rasterize_draws_a_distorted_image_between_its_corners`, `image_info_measures_a_distorted_image_at_its_middle`, `a_distorted_image_saves_and_reads_back`, `links::update_links_keeps_a_distorted_images_corners`, `links::relink_embed_and_unembed_keep_a_distorted_images_corners`, `links::unembed_to_a_folder_keeps_a_distorted_images_corners`, `links::embed_reads_a_distorted_images_file_between_its_corners`, `links::relink_of_all_instances_keeps_the_corners_of_distorted_images_in_symbols`, `cmd::fileio::tests_psdread::relink_follows_the_clipping_path_of_a_distorted_psd`, `cmd::fileio::tests_psdread::unembed_keeps_the_clipping_path_of_a_distorted_psd`, `cmd::links::tests::points_past_the_horizon_are_mapped_as_a_distort_maps_them`, `recolor::theme_picker_reads_a_distorted_image_where_it_is_drawn`, `addons::cutting::weed::tests::a_distorted_image_is_measured_by_the_frame_through_its_corners`; render `outline_mode_draws_a_distorted_images_frame_through_its_corners`, `meshwarp::outline_mode_paints_a_distorted_images_pixels_once_where_its_pieces_overlap`, `meshwarp::the_canvas_cuts_a_distorted_images_mesh_for_the_zoom`, `objectfx::a_distorted_image_is_opaque_between_its_corners_and_its_shadow_follows_them`, `objectfx::a_distorted_image_is_opaque_inside_its_corners_at_every_zoom`; svg `warp_pieces::a_distorted_image_is_written_between_its_corners`; pdf `compression::a_distorted_image_is_written_with_its_corners_on_its_quad`; eps `a_distorted_image_is_written_with_its_corners_on_its_quad`, `ai_editing::tests::a_distorted_image_nested_as_deep_as_the_limit_is_written_as_its_nearest_placement`, `legacy_ai::tests::a_distorted_image_nested_as_deep_as_the_limit_is_written_as_its_nearest_placement`; cad `a_distorted_image_is_written_as_its_nearest_parallelogram_with_a_warning`; metafile `a_distorted_image_is_its_mesh_with_clips_and_its_nearest_parallelogram_without`; tools `xform::eyedropper::tests::clicking_an_image_samples_its_pixels`; plugins `objects::tests::a_distorted_image_comes_with_its_corners`; ui-egui `i18n::tests::distorted_image_messages_are_in_complete_catalogs`). + - Perspective Distort and Free Distort (`object.distort`) move an image's four corners exactly onto the handles when the image is distorted alone; with other objects the handles stand for the whole selection, and the image's corners follow the same warp without necessarily landing on them. The image's pixels are drawn in perspective between its corners on the canvas, in print and in every export that holds images, as a mesh of affine image pieces (DXF and WMF write the nearest parallelogram and warn, as the `.ai` writers do for an image nested 8 deep in opacity masks, symbols, live objects and pattern tiles, or in a legacy `.ai` in symbols and live objects, not counting ordinary groups and layers, and leave out an image nested deeper; HP-GL plots leave images out); the native file saves the corners; bounds, clicks, blends, the Eyedropper, Outline view, the Color Theme Picker and Weed Box and Lines follow them; Image info and Link Info measure the image at its middle; and corners that would fold the image over, fall on one line, cross the warp's horizon or lie too close together for a perspective map are refused. Crop Image, Image Trace, Create Gradient Mesh and Place with Replace refuse a distorted image (Place with Replace refuses only when the object it measures is the distorted image, so it does not refuse when the placed file is text or the replaced object is a DCS file's plates); Update Links and Relink put the file's pixels between its corners, with the file's clipping path drawn through them, and Embed and Unembed keep them; Rasterize makes a plain image of it. All of this is VectorCraft's own rule (doc `image_quad::tests`, `blend::tests::steps_between_distorted_images_have_corners_between_theirs`; engine `xform::distort_puts_an_images_corners_on_the_handles`, `distort_moves_an_image_and_a_path_as_one`, `distort_refuses_a_folded_image_and_crop_and_trace_refuse_a_distorted_one`, `distort_names_the_horizon_and_an_unchanged_distort_of_a_distorted_image_records_nothing`, `distort_of_a_blend_holding_an_image_is_not_refused`, `free_transform_distort_drag_on_an_image_is_one_undo_step`, `mask_on_a_distorted_image_follows_its_corners`, `a_transform_effect_moves_a_distorted_images_corners`, `a_transform_after_a_warp_moves_a_distorted_image_once`, `baked_raster_effect_pixels_replace_a_distortion`, `rasterize_draws_a_distorted_image_between_its_corners`, `image_info_measures_a_distorted_image_at_its_middle`, `a_distorted_image_saves_and_reads_back`, `links::update_links_keeps_a_distorted_images_corners`, `links::relink_embed_and_unembed_keep_a_distorted_images_corners`, `links::unembed_to_a_folder_keeps_a_distorted_images_corners`, `links::embed_reads_a_distorted_images_file_between_its_corners`, `links::relink_of_all_instances_keeps_the_corners_of_distorted_images_in_symbols`, `cmd::fileio::tests_psdread::relink_follows_the_clipping_path_of_a_distorted_psd`, `cmd::fileio::tests_psdread::unembed_keeps_the_clipping_path_of_a_distorted_psd`, `cmd::links::tests::points_past_the_horizon_are_mapped_as_a_distort_maps_them`, `recolor::theme_picker_reads_a_distorted_image_where_it_is_drawn`, `addons::cutting::weed::tests::a_distorted_image_is_measured_by_the_frame_through_its_corners`; render `outline_mode_draws_a_distorted_images_frame_through_its_corners`, `meshwarp::outline_mode_paints_a_distorted_images_pixels_once_where_its_pieces_overlap`, `meshwarp::the_canvas_cuts_a_distorted_images_mesh_for_the_zoom`, `objectfx::a_distorted_image_is_opaque_between_its_corners_and_its_shadow_follows_them`, `objectfx::a_distorted_image_is_opaque_inside_its_corners_at_every_zoom`; svg `warp_pieces::a_distorted_image_is_written_between_its_corners`; pdf `compression::a_distorted_image_is_written_with_its_corners_on_its_quad`; eps `a_distorted_image_is_written_with_its_corners_on_its_quad`, `ai_editing::tests::a_distorted_image_nested_as_deep_as_the_limit_is_written_as_its_nearest_placement`, `legacy_ai::tests::a_distorted_image_nested_as_deep_as_the_limit_is_written_as_its_nearest_placement`; cad `a_distorted_image_is_written_as_its_nearest_parallelogram_with_a_warning`; metafile `a_distorted_image_is_its_mesh_with_clips_and_its_nearest_parallelogram_without`; tools `xform::eyedropper::tests::clicking_an_image_samples_its_pixels`; plugins `objects::tests::a_distorted_image_comes_with_its_corners`; ui-egui `i18n::tests::distorted_image_messages_are_in_complete_catalogs`). + - Object › Create Object Mosaic on an image changed by Perspective Distort or Free Distort places each tile's cell of pixels between the image's corners, so the tiles are four-sided shapes that follow the perspective, in one undo step; a new size scales them from the top left of the image's bounds, and the spacing and Use Ratio measure a pixel by the mean length of the image's two sides along each axis (VectorCraft's own rule; engine `object_mosaic_tiles_of_a_distorted_image_follow_its_corners`). - The Free Transform widget's Constrain works in Free Distort as well as in Free Transform ([the help page](https://helpx.adobe.com/illustrator/using/tool-techniques/free-transform-tool.html)). With Constrain on, or Shift held, a corner dragged in Free Distort moves only along the line through the opposite corner, in the box's own proportions, and the other three corners stay in place; on a turned box the line runs through the box's own corners. The line is VectorCraft's own rule. Cmd/Ctrl+Alt+Shift on a corner still drags in Perspective Distort, where Constrain stays unavailable (tools `xform::free::tests::free_distort_corner_keeps_to_its_diagonal_with_shift_or_constrain`, `shift_pressed_during_a_free_distort_drag_constrains_it`, `a_turned_box_is_constrained_along_its_own_diagonal`, `along_diagonal_of_a_degenerate_box`; engine `xform::free_transform_constrained_distort_keeps_the_corner_on_its_diagonal`; ui-egui `free_transform::tests::the_widget_sets_the_mode_and_a_corner_drag_then_distorts`). - With Smart Guides › Transform Tools on, a Free Transform shear (Cmd/Ctrl on a side handle) shows its angle next to the pointer, as the Shear tool does, and a handle drag that turns from a scale into a shear and back shows only the current operation's value ([the help page](https://helpx.adobe.com/illustrator/desktop/measure-and-align/grids-and-guides/smart-guides-options.html)). The angle's sign and its one decimal place are VectorCraft's own rule, the same as the Shear tool's label (tools `xform::free::tests::shear_drag_shows_its_angle_with_transform_tools_guides`, `a_handle_drag_that_changes_operation_relabels_it`). - Native macOS menu bar, vector tool cursors, a command palette (Help › Search Commands…), middle-button panning with any tool. Native menus explicitly end tracking on command selection, outside window presses and Escape; menu updates wait until tracking ends, and a dismissing press never starts a canvas gesture (M14.8).