A .ai file's editing data can include a placed EPS file's bytes between
%%BeginDocument: and %%EndDocument. The reader did not read those bytes:
in the %AI5_BeginPlace form the placed file showed only the preview the
data keeps of it, or an unread placeholder box without one, and in the
version 7 form the art the file draws came in as editable paths with a
note that placed files weren't read.
- The reader keeps those bytes (up to 256 MB) and makes the placed file a
placed document of them, in the file's bounding box where the
matrix puts it. It draws its art whether or not its file is found, and
a native save keeps the bytes. The version 7 form's placed EPS art is
no longer editable on open.
- A placed file stays as before when its bytes are a DCS file (File >
Place makes those linked images), have no bounding box of their own,
carry a VectorCraft document (as VectorCraft's EPS export writes),
don't read as an EPS file, or belong to a file named .ai or .ait.
What reading the bytes warns of is in the open result.
- One with a preview that an image variable binds stays the linked image
showing its preview, as a placed PDF page does.
- The link takes the size and hash of the bytes, so a file found unchanged
is neither missing nor modified.
- Drawing and the open check each read at most 8 placed EPS files inside
one another, so a file whose included files include others opens.
The open check draws the placed documents inside the bytes from their
previews, and it reads each included file once at each depth. A file
nested 12 levels deep opens with at most 8 drawing reads and 72
checks.
- File > Package with Copy Fonts reads the type of a placed EPS file, as
it reads a placed PDF page's, and of the EPS files it includes in turn,
pattern art included.
- On %_ lines the %_ that starts each line is taken off. Then one line
end is taken off the end of the bytes when another line end comes
before it: the one the %%BeginDocument: line ends with when the bytes
end with it, otherwise the last one. An LF after a CR is kept with it
when the file's first line ends with CRLF.
Docs: docs/target-app-parity.md.
A round or projecting cap draws a dot for a subpath that never leaves
its first point: a closed lone anchor, or a line or curve back to the
same point. StrokeLayer::hits ruled the click out by the box of the
segments, which leaves out a closed lone anchor, and then measured
only segments with length, so a click on the dot missed. The fast
path for a plain centered stroke in hit_leaf also returned no hit for
a path whose only subpath is a closed lone anchor.
hits now measures each such subpath as the dot the stroke draws: a
disc for a round cap and an axis-aligned square for a projecting cap,
as wide as the stroke's body, on undashed strokes without a width
profile, which are the strokes that draw a dot. Inside and outside
strokes keep to their side of a closed path. Butt caps draw no dot
and still miss. The fast path hands a click near a closed lone anchor
to the full check.
Hover, Select Behind, Direct Selection and the Eyedropper go through
the same hit test, and a marquee over the anchor already selects it.
A side of an envelope's content shorter than 1e-6 pt, not only one of
zero length, has its margins measured as shares of the other side
(envelope_margin_lengths). docs/mcp.md, the object.envelope.info params
text and the bounds_margin doc comment now state that threshold.
A round or projecting cap draws a dot for a closed subpath of one anchor.
The bounds the effects are measured by left that dot out: the visual and
cull bounds, the box Rasterize makes its image over, and the reach of an
effected path's raster effects. A path of only lone anchors was measured
at the origin.
- `vectorcraft_geom::path::drawn_curve_bounds` measures a kurbo path as
`PathData::drawn_bounds` measures the anchors it stands for.
- `crates/render/src/fx` measures effected paths with it, and a path that
draws nothing by its anchors, as `Node::visual_bounds` does.
- A stroke measured along its segments (miter and bevel joins, projecting
caps) gives the dot of a closed lone anchor its reach.
With the Selection tool, the first Cmd-click (Ctrl on Windows and Linux)
now always goes to Direct Selection or Group Selection, also over a
selected object: it picks the object under the pointer, a member of a
group included, and arms Select Behind. While Cmd stays held, each
further Cmd-click over the selection selects the next object under the
pointer, counting the members of groups one by one, and comes back to
the topmost after the last. Letting go of Cmd (a pointer, hover or key
event without it), choosing another tool or switching documents ends it.
Before, the first Cmd-click over a selected object selected the object
behind it at once, and Select Behind stepped through whole groups, so a
member lying under another member of the same group could not be
reached that way.
- doc::hit::leaves_at lists the objects a Direct Selection click picks
under a point, topmost first, in one traversal of the document; a
clipping mask or a group drawn with its own geometry effects falls back
to repeated hit tests. The list stops at 256 objects.
- The session keeps the arming (Session::behind_armed) and passes it to
the tools as ToolContext::behind_armed.
- Docs: docs/control-protocol.md (ui.pointer), docs/mcp.md,
docs/target-app-parity.md and docs/ui-parity.md.
The previous commit made PathData::bounds hold the point of a subpath of
one anchor. Node::visual_bounds measures a path from that box, so a lone
anchor that draws nothing (an open one, or a closed one under a butt cap
or with no stroke) widened the visual box by the stroke's reach. The
renderer draws a lone anchor only as the dot of a round or projecting
cap on a closed subpath (point_dots in crates/effects/src/stroke.rs).
- PathData::drawn_bounds measures the segments, and the lone anchors of
closed subpaths when a cap draws dots. Node::visual_bounds measures
paths and compound paths from it, falling back to the geometric box
when nothing is drawn. Geometric bounds still hold every lone anchor.
- The .ai envelope import's box of what type's outlines paint relied on
PathData::bounds leaving lone anchors out. It now removes contours of
zero length from the baked pieces before measuring them, so
a_contour_of_zero_length_paints_nothing passes unchanged.
With Object Selection by Path Only off (the default), the Selection,
Direct Selection and Group Selection tools, Object Highlighting and a
right-click's selection now pick a closed path or compound path that
has no fill by a click inside its closed subpaths. Before, such a shape
could only be picked on its path, and a click inside started a marquee.
The inside counts only where no other object is hit: a click first
looks for what paints at the point, the same as before, and only then
for the topmost unfilled closed shape around it, so art drawn inside a
frame is still picked before the frame. Select Behind lists those
shapes after the objects that paint there, and Direct Selection in a
dynamic symbol's art picks parts in the same order. Open paths, guides
and clipping paths are still picked by their path only, and Outline
view is unchanged. With Object Selection by Path Only on, the inside of
an unfilled shape takes no click, as before.
Three tests clicked inside an unfilled square and expected nothing to
be selected: the Selection and Direct Selection center point tests and
the outside-stroke reach test. They now run with Object Selection by
Path Only on, and the Direct Selection and stroke reach tests also
check that the click selects the square with it off.
Fixes#9175
An envelope whose file saves the size of its contents with their
strokes maps from that box, with margins stored as shares of the
contents' height and width. A straight line along an axis has no
height (or no width), so it got no margins and mapped from its
zero-height geometric box instead.
Margins along a side with no length are now shares of the other
side's length (envelope_margin_lengths). The reader, the envelope's
map, leaving Edit Contents and the .ai writer all measure through it,
so a stroked line opens mapping from its stroked box and saves that
box's size again.
Docs: object.envelope.info params text, docs/mcp.md,
docs/target-app-parity.md.
In Outline mode without Show Images in Outline Mode, a placed document
with an effect that changes geometry (Transform, Roughen, plug-in
effects), its own or its group's, drew its file's art reshaped and
without the X. The effects now reshape the crossed box instead, so a
Transform effect moves the crossed box.
- While a frame draws placed documents crossed, a placed document's art
is its box with both diagonals (PlacedDocument::crossed_art), so every
effect and evaluation that reads that art uses the crossed box.
- Layers are drawn and measured in the mode their Layer Options give
them: a template layer in Outline view still shows the file's art,
and a layer or sublayer whose Preview is off shows the crossed box.
A layer with effects of its own now follows its Layer Options too;
before, it drew in the view's mode.
- Kept effect art, cull bounds and the areas redrawn after an edit are
measured in that mode and kept apart per mode.
Docs: docs/ui-parity.md row done, docs/mcp.md outlineImages.
Docs conflicts: main's "Last updated" banner; both sides' evidence and
history rows, newest first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A selected group or layer outlined and marked a member made into a guide
while the guides were hidden, and the art of a template sublayer while
View > Hide Template was on, although the canvas does not draw them.
- Node::hidden_by_view (crates/doc/src/node/ops.rs) holds the rule; the
renderer's left_out now uses it too.
- walk_drawn and the overlay's point limit in canvas/outline.rs leave out
the members the view hides, so the selection's outlines, key outline,
anchors, hover outline and point count skip them.
- The selection's bounds are unchanged.
The selection outline and the hover highlight drew a symbol instance as
the box square to the page around it, so a turned, skewed or
perspective instance showed a box larger than its frame. Type in
perspective had the same box.
Node::drawn_corners gives the four corners of an instance's art box
placed by its transform, and of type's flat bounds, both through the
projection of an object in perspective. node_outline joins them, as it
already does for a placed document's corners.
A selected ruler guide that a transform turns to an angle becomes a
selected guide path, but the reply's ids left it out: object.rotate
with copy on a lone guide returned {"ids": []}. transform_ruler_guides
now returns the ids of the paths it adds, and the transform commands
add them after the transformed objects, on the direct-selected anchor
route too.
A selected ruler guide was left out of every transform but a move: the
Rotate tool did nothing with only guides selected, and Object › Transform
› Rotate… refused with "nothing selected".
Each selected ruler guide now transforms as the line Release Guides makes
of it (across its artboard, or across the artboards' bounds for a canvas
guide), about the center of the selected objects' box and those lines
together. A guide that ends up vertical or horizontal stays a ruler guide:
a half turn keeps it and a quarter turn makes a horizontal guide vertical.
At any other angle it becomes a guide path along its line, on the guide's
layer, so it snaps, releases, locks and saves as other guide paths do.
- Object › Transform › Rotate… (Copy included), Transform Again and the
Rotate tool's drag and Alt-click work with only guides selected, in one
undo step. A turn that leaves the guides where they were records none.
- Scale, Reflect, Shear and the bounding box now transform selected guides
along with the selected objects and direct-selected anchors, where
before the guides stayed put.
- Locked and hidden guides, guides with ids given and guides with
Transform Objects off do not transform. `absolute` with only guides
selected is an error.
Part of #2418.
Brings in main at 08425c9610 through #9090's merge of it. The hidden-member tests move to canvas/selection/tests.rs, where main now keeps the selection outline and anchor tests, and check the selection's outlines, anchors and hover outline directly.
Since #8610, a document in millimeters, centimeters, inches or picas is
exported with that unit on the root width and height. A document in
feet, feet and inches, yards, meters, Q or Ha still got unitless point
values, which SVG readers take as CSS pixels at 96 per inch, so the art
opened at 75% of its size. These units have no SVG unit identifier, so
the export now writes feet and yards in inches, meters in centimeters,
and Q and Ha in millimeters. The viewBox stays in points, and
VectorCraft reads the file back at the same size.
A tag id in a native file that is negative, a fraction or text read as
an error, so the whole file failed to open. It now reads as 0, and
opening gives the tag a new id as it does for a missing or repeated id,
with its name and value kept.
The Scripts line in docs/target-app-parity.md now describes
PageItem.tags and Document.tags separately: Document.tags reads, renames
and deletes tags but its add throws.
- Add Unit::format_area(self, pt2: f64) -> String to format area in document units.
- Add pathArea (pt²) to document.info output and insert Path Area row in Objects section.
- Calculate compound path net enclosed area using fill rules (Non-Zero / Even-Odd), subtracting holes.
- Exclude guides and open paths, and avoid double-counting on nested compound paths.
- Update progress evidence and entries in docs/gaps.md and docs/target-app-parity.md (identifying Path Area as a VectorCraft addition beyond reference panel).
The white checks for colorized images in PDF export, EPS export and Print
Ink Fixes now go through DiscardWhite, which replaces
Document::spot_ink and Document::discards_white_overprint. Printed
separations read DiscardWhite with the spot inks they print, so a white
spot ink converted to process inks knocks out there.
New Document's More Settings now shows the columns a preset's rows give
the current artboards, and a new layout or column count replaces those
rows, in the dialog main rewrote.