The two Direct Selection preference tests in
crates/ui-egui/src/tests/removeanchors.rs now use
crate::testing::ui_context() and app.canvas_view() to place the click,
as the other canvas tests on main do.
A stroke that starts and ends on an open path away from its ends now looks
at the way it runs along the path at each end. Where it starts it replaces
the part it runs along; where it lands it joins the part it runs into. So it
replaces the part between (and the path stays open), keeps the part between
and closes the path along the stroke, or, when its two ends disagree, keeps
the start's choice and ends where the pen is lifted.
An end runs along the path when its first stretch, as long as Edit Selected
Paths' distance, stays within that distance and moves along the path more
than away from it. An end that leaves or meets the path squarely follows the
other end; when both do, the stroke closes the path only if it goes round
both pieces beyond its ends.
This brings back closing across an open shape's opening (a C drawn over both
arms closes into a ring), which the previous commit had taken out, and keeps
a bump over an L's corner redrawing the corner.
A stroke that starts and ends on an open path away from its ends now always
replaces the part between and leaves the path open. Before, a stroke across
the opening (over most of an L, or across a C) could keep the part between
and close the path along the stroke instead. Closing stays where the Pencil
shows the closing cursor: a stroke from one end that finishes on the other.
The new General preference Delete Removes Anchor Points and Keeps Paths
Joined (`deleteKeepsPathsJoined`, off by default) is the default of a new
`keepJoined` param of edit.clear (Delete, Backspace, Edit › Clear, and the
Layers panel's Delete button while no row is highlighted). With it on,
Delete removes the direct-selected anchors of each path as Remove Anchor
Points does, refitting the curve around each one, so a closed path stays
closed and an open path stays in one piece. The next anchor along is selected (the one
before at an open path's end), so the next Delete goes on along the path.
- Objects selected whole are deleted and paths with a selected segment
are cut there, as before, in the same undo step. A path left with fewer
than two anchors is deleted; a compound path keeps its other members.
When no changed subpath keeps two anchors, the path stays selected
whole, as Remove Anchor Points leaves it.
- The value used joins the journal entry, so a replay removes the anchors
the same way whatever the preference is at the time; a saved step
without it opens the paths as it did when it was recorded. A keepJoined
value that is not a boolean is an error, also with ids, where the param
has no other effect. path.deleteAnchors and Cut are unchanged.
- The Smart Pen does not take the Delete key, so Delete follows the
preference with it chosen too.
- The label and its description have a row in every catalog.
Without keepJoined and with the preference off, edit.clear gives the same
result as before.
Part of #8326
Docs: docs/mcp.md, docs/target-app-parity.md.
The merge of main brought in code that indexes the anchor list while
smooth_open now keeps it in an EditsFromEnd, which has no indexing, so
the engine did not build. The anchors at both ends of a run and of its
neighboring segments are now read from the span that EditsFromEnd::get
returns.
docs/mcp.md now says the measuring spacing is a target (at least 4 and at
most 1,024 pieces per curved segment, fewer on subpaths of more than 256
segments) and gives the acceptance test as formulas: t1 <= t0 + 0.001 * s
and fewer anchors, t0 - t1 >= 0.000001 * s, or b0 - b1 > 0.0001 * b0,
with s the larger of t0 and 1. The roughness doc comment says the points
are about `step` apart.
path.smoothRegion kept every changed result. A drag along the top of a
clean ellipse split it from 4 to 5 anchors without smoothing it, took
away its Live Shape and added an undo step, and a third drag left it
with 7 anchors and about 20% more turning.
Each subpath's result is now measured against the subpath at one
spacing: how much it turns along its length, with each turn at an
anchor counted twice, and how much it bends. The result is kept only
when it turns no more than a thousandth more and has fewer anchors,
turns less or bends less. Otherwise the subpath stays as it was; a path
with no kept subpath keeps its Live Shape, is left out of ids and the
counts, and a call that keeps nothing adds no undo step. The measure and
the thresholds are VectorCraft's own.
Three tests that dragged over a convex curve with nothing to smooth now
drag over a sharp peak or crest, so they still test the reach search
and a closed path of two anchors.
Simplify and Smooth refit a closed path from its first corner and kept
that order, so the path's first anchor moved and its dashes started
somewhere else. A refit now starts at the old first anchor when it keeps
one there, otherwise at a new anchor where the refit passes nearest that
point while the result still has fewer anchors than the path had, and
otherwise at the refit's nearest anchor. Its direction stays the same.
A direct-selected run across the start follows the same rule; before,
the path started at the run's end anchor.
The Smooth tool's start_nearest moves into vectorcraft-pathops, and both
commands call it with the limit on anchor count above.
A Smooth drag that ends partway along a path splits each segment it
leaves at the edge of its reach, so the anchor it adds there lies on
that edge. The next drag over the same place reaches that anchor and
only a sliver of the segment beyond it. Splitting that sliver gave the
refit a segment of almost no length to end on, so the refit lost the
path's direction there: on an ellipse dragged along its lower half, the
second drag added two more anchors and left two 71.6° corners, and
later drags turned the ellipse more each time.
A segment leading out of the smoothed stretch that is in reach for no
more than 1/64 of the reach from the stretch's anchor is now left as it
is, and the stretch ends at that anchor. The same drags on the
ellipse now keep the anchors of the first drag and leave no corner.
A Smooth drag measured every anchor of each path against every stretch of
the drag, and every curved segment's box against every stretch twice, so a
release on a path of 100,000 anchors made tens of millions of measures
however short the drag was.
- The drag's stretches are listed once per release in a grid over the
drag's bounds grown past the reach. An anchor outside those bounds is out
of reach without measuring, and a point or box is measured only against
the stretches listed in the cells it covers. Every query gives at least
the stretches the whole-drag measure finds in reach, so the marks, the
cuts and the smoothed path are the same as before.
- The refitted runs of a path are put back from its end without moving the
rest of the anchor list for each run.
On a curved path of 100,000 anchors, a drag of 200 points over 200 pt of it
makes 7,533 measures to find the curved segments in its reach, where it
made 19,899,801.
path.smoothRegion read a radius below 0 as 0 and moved a fidelity into its
range, and path.joinScrub read a tolerance below 0 as 0. Each now refuses
a value outside its range with an error naming the key, and the document,
the selection and the undo history do not change: radius and tolerance
0.001 to 1000 pt (the Path Eraser's width range), fidelity 0.000078125 to
about 3195 pt (the Smooth tool's 0.05 to 100 px at the highest and the
lowest zoom). A key left out or null keeps its default.
The Smooth, Join and Path Eraser tools, and an Alt smoothing drag with the
Pencil, Paintbrush or Blob Brush, keep what they send within these ranges
at any zoom, also when the interface zoom puts the tool's zoom past the
view's range.
Docs: params text, docs/mcp.md, docs/target-app-parity.md.
The end handle's drag now applies the release position before it ends, so a press let go
away from the handle without a drag event still changes the length. An edit made outside
the tool during the press ends the drag, so a later preview does not overwrite it. C and
[ ] do nothing until the drag ends. A selected compound path shows the length handles of
the paths it holds, and path.quickPenLength checks its result against the same canvas rule
as the drag.
The Quick Pen tool shows a handle beyond the start and the end of the
path being drawn, or, while none is, of the selected path, where that
end is a straight line or a circular arc. Dragging the handle changes
the length of the line or arc there, as the Quick Pen help page
describes:
https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/draw-with-quick-pen-tool.html
- A line keeps its other point and its direction. An arc keeps its
other point, its circle and the way it turns; its sweep follows the
pointer around the circle, up to 359 degrees. A drag stops where the
path would reach past the canvas.
- Each drag is one undo step, and Escape during the drag takes it back.
The path being drawn goes on from the new end. The pieces the drag
does not change stay pieces, so C and [ ] still change the last one,
and a dragged last arc keeps at least 1 degree.
- A click on a handle that does not drag adds a point, closes the path
or starts one, as a click anywhere else does.
- path.quickPenLength {id, subpath?, end?, length} sets the same length
for agents and scripts (params text and docs/mcp.md).
The handle's place 20 screen points beyond the end, the 359 degree
limit, the 1 degree minimum, Escape during a drag, the handles on a
selected path and the dragged end not snapping to Smart Guides are
VectorCraft's own rules.
Part of #2660 (reported by earlvanze).
A new tool in the Pen tool's group, chosen with Alt+P (Option+P on
macOS), draws paths of straight lines and circular arcs, as the Quick
Pen help pages describe:
https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/draw-with-quick-pen-tool.htmlhttps://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html
- A click sets the start point; each click, or a press dragged to where
it is let go, adds a line, a continuous arc (it leaves the last point
in the path's direction) or a sharp-corner arc, as the tool's action
says. Each piece is one undo step.
- Alt (Option) pressed and let go on its own switches to the next
action. C flips the last sharp-corner arc to the other side of its
chord, and [ and ] make the arc size 15 degrees smaller or larger.
- A click on the first point closes the path, a click on an end of an
open path continues it, and Escape or Enter ends it. An edit made to
the path from outside the tool also ends it.
- path.quickPen {start | id, subpath?, keep?, pieces, closed?} draws
the same path for agents and scripts. The action and arc size are
kept with the preferences.
The 180 degree default arc size, its 15 degree steps, the side an arc
bulges to and Enter ending the path are VectorCraft's own rules.
Part of #2660 (reported by earlvanze). Not yet: the on-canvas toolbar,
dragging a path's ends to change its length, Ctrl+scroll for the arc
size, and editing and deleting with the tool.
path.freehand ignored a connect given without extend and drew a new
path. It now refuses it with "connect needs extend". A connect given
with extend is checked (its id, a path other than the one extended
with an open end, and an end of "start" or "end") before a stroke of
one point returns, so a bad connect is refused there too, and
brush.freehand no longer changes the path's brush or the selection
before refusing it. A null connect is still a key left out.
Docs: params text, docs/mcp.md, docs/target-app-parity.md. i18n: the
new message in the catalogs that carry the other connect messages.
path.split (Scissors) and path.cutAtAnchors (Cut Path at Selected
Anchor Points) keep the source path's fill and stroke settings on the
paths they make, and now set every stroke's alignment to Center in the
same undo step, as the help page describes:
https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/split-paths.html
Every stroke row is reset, hidden ones included. A path of several
subpaths has one appearance, so its other subpaths' strokes are
centered too, and a cut member of a compound path centers the compound
path's strokes. An appearance whose strokes are already centered is
left shared. Knife, the erasers and Divide are unchanged.
path.eraseSegments checked only that `width` was a positive number, so a
width such as 1e300 erased every selected path and a width such as 1e-300
sampled the path too coarsely to find the band. It now refuses a width
outside 0.001 to 1000 pt with "`width` must be from 0.001 to 1000" before
reading the document; nothing changes and no undo step is recorded. Left
out or null, the width is still 8 pt. The range is VectorCraft's own: it
holds every width the Path Eraser tool sends across the view zoom and UI
Scaling limits, and its top matches the Eraser's largest Size.