Commit Graph
167 Commits
Author SHA1 Message Date
BFlat 7df7885a11 Merge pull request #4221 from ncic/pencil-redraw-extend
Pencil: Edit Selected Paths follows a stroke lifted away from the path, carves, loops and closes
2026-11-25 17:44:43 +07:00
BFlat 96d12ebf06 Merge pull request #9111 from dotCooCoo/feat/delete-keeps-paths-joined
Direct Selection: optional preference keeps paths joined when Delete removes anchors
2026-11-25 11:31:40 +07:00
dotCooCoo 342ce8de51 Merge main into feat/delete-keeps-paths-joined
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.
2026-11-24 19:17:02 -08:00
dotCooCoo b4c214169b Merge main into feat/quick-pen-length-handles 2026-11-24 09:16:09 -08:00
BFlat fd349e4d11 Merge pull request #9015 from dotCooCoo/fix/smooth-no-worse-pass
Smooth: a drag that would not make a path smoother leaves it as it was
2026-11-24 16:05:00 +07:00
ncic 563cbb298c Pencil: a redraw on an open path follows the way its ends run along it (#3793)
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.
2026-11-23 04:58:44 +01:00
ncic aea7ae116a Pencil: a redraw stroke in the middle of an open path never closes it (#3793)
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.
2026-11-23 01:42:18 +01:00
ncic 3b668aec46 Pencil: a tall redraw keeps an open line's ends and a thin shape's body (#3793) 2026-11-22 21:59:44 +01:00
dotCooCoo 17c2f43485 Direct Selection: optional preference keeps paths joined when Delete removes anchors
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.
2026-11-22 07:57:33 -08:00
dotCooCoo d1eb3f4ad3 Merge main into feat/quick-pen-length-handles 2026-11-22 01:38:35 -08:00
dotCooCoo 26200f0599 Smooth: read the anchors around a run through the edited list
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.
2026-11-21 21:44:17 -08:00
dotCooCoo cd03842fb1 Docs: path.smoothRegion states its sampling limits and acceptance test
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.
2026-11-21 21:18:03 -08:00
dotCooCoo 68602e24ad Merge main into fix/smooth-region-bounds-prefilter 2026-11-21 21:11:55 -08:00
dotCooCoo f312abf05a Merge main into fix/smooth-no-worse-pass 2026-11-21 20:52:42 -08:00
BFlat f03d04b91b Merge pull request #8996 from dotCooCoo/fix/simplify-smooth-keep-closed-start
Paths: Object > Path > Simplify and Smooth keep a closed path's start
2026-11-22 11:38:13 +07:00
BFlat 37610608f1 Merge pull request #8976 from dotCooCoo/fix/smooth-region-rejects-bad-params
Smooth: path.smoothRegion and path.joinScrub refuse a radius, fidelity or tolerance out of range
2026-11-22 11:37:54 +07:00
dotCooCoo e10c3f1157 Merge main into feat/quick-pen-length-handles 2026-11-21 20:17:47 -08:00
dotCooCoo f54afb117b Smooth: a drag that would not make a path smoother leaves it as it was
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.
2026-11-21 03:56:08 -08:00
dotCooCoo 38e36aeb81 Paths: Object > Path > Simplify and Smooth keep a closed path's start
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.
2026-11-21 01:00:16 -08:00
dotCooCoo 6458bdd9c5 Smooth: a drag that reaches only a sliver of the next segment no longer splits it
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.
2026-11-20 23:52:25 -08:00
dotCooCoo 5a2eae86a7 Smooth: a drag over a long path measures only the anchors and segments near it
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.
2026-11-20 23:43:00 -08:00
dotCooCoo 342341a55f Smooth: path.smoothRegion and path.joinScrub refuse a radius, fidelity or tolerance outside its range
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.
2026-11-20 23:42:48 -08:00
dotCooCoo 88e3575a1e Quick Pen: a length drag ends where the pointer is let go and ignores outside edits and piece keys
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.
2026-11-19 17:22:09 -08:00
ncic ef84260edb Merge remote-tracking branch 'upstream/main' into pencil-redraw-extend
# Conflicts:
#	crates/engine/src/cmd/draw2/commands.rs
#	docs/target-app-parity.md
#	docs/ui-parity.md
2026-11-20 00:24:54 +01:00
dotCooCoo f9367c4c10 Pen: Quick Pen handles at a path's ends make its line or arc longer or shorter
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).
2026-11-19 13:59:39 -08:00
dotCooCoo df614fb80c Pen: Quick Pen tool draws lines, continuous arcs and sharp-corner arcs
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.html
https://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.
2026-11-19 01:29:06 -08:00
ncic 59461a08a9 Merge main into pencil-redraw-extend
# Conflicts:
#	docs/target-app-parity.md
#	docs/ui-parity.md
2026-11-18 23:02:27 +01:00
dotCooCoo 18c4a7b965 Merge main into feat/stylus-wheel 2026-11-18 07:27:22 -08:00
yoriswind 3f09579dcd Merge upstream main to resolve PR #6601 documentation conflicts 2026-11-18 02:41:17 -08:00
ncic 8ff0d4b236 Merge main into pencil-redraw-extend
# Conflicts:
#	crates/engine/src/cmd/draw2/commands.rs
#	docs/target-app-parity.md
#	docs/ui-parity.md
2026-11-18 07:47:19 +01:00
BFlat 9e811a7d05 Merge pull request #8422 from dotCooCoo/fix/path-freehand-connect-needs-extend
Pencil: path.freehand refuses connect without extend
2026-11-18 13:11:10 +07:00
BFlat 18f8c57a5a Merge pull request #8037 from dotCooCoo/fix/erase-segments-width-bound
Path Eraser: path.eraseSegments refuses a width outside 0.001 to 1000 pt
2026-11-18 10:21:33 +07:00
BFlat 3a9bb87022 Merge pull request #7925 from dotCooCoo/feat/brush-options-of-selected-object
Brushes: Options of Selected Object changes one brushed path's brush settings without changing the brush
2026-11-18 10:18:41 +07:00
ncic 5048e2a390 Pencil: a redraw stroke shorter than the edit distance keeps both ends on the path 2026-11-17 22:31:34 +01:00
dotCooCoo 6252d4b29e Pencil: path.freehand refuses connect without extend
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.
2026-11-17 11:56:49 -08:00
ncic ada3beb48a Merge remote-tracking branch 'upstream/main' into pencil-redraw-extend
# Conflicts:
#	crates/engine/src/cmd/draw2/commands.rs
#	crates/engine/src/cmd/draw2/freehand.rs
#	docs/target-app-parity.md
#	docs/ui-parity.md
2026-11-17 19:55:28 +01:00
yoriswind 5f0e011379 Preserve open outlines painted by ancestor strokes 2026-11-17 07:48:02 -08:00
yoriswind 1904657eb5 Merge main and preserve independent Eraser progress notes 2026-11-17 04:07:48 -08:00
dotCooCoo 14d814b9f0 Merge main into feat/stylus-wheel 2026-11-17 03:57:49 -08:00
dotCooCoo aac6250a07 Merge main into fix/blob-params-rejected 2026-11-16 12:01:23 -08:00
yoriswind 0774371250 #6582: preserve straight fill closure during erasure 2026-11-16 10:57:58 -08:00
yoriswind ffa507e293 M2: reconcile Eraser imports with current Scissors changes (#6582) 2026-11-16 09:44:37 -08:00
dotCooCoo a10c403df6 Scissors: paths a cut makes have every stroke aligned Center
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.
2026-11-16 03:46:53 -08:00
yoriswind 573a924d19 M2: preserve evaluated ancestor gradients while erasing 2026-11-15 23:07:02 -08:00
dotCooCoo ea5ab86429 Path Eraser: path.eraseSegments refuses a width outside 0.001 to 1000 pt
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.
2026-11-15 21:35:25 -08:00
yoriswind 3d5cce66e1 M2: reconcile gradient-preserving Eraser fix with main (#6582) 2026-11-15 21:22:58 -08:00
yoriswind 1012d7d2b5 M2: preserve gradient placement while erasing 2026-11-15 21:09:45 -08:00
dotCooCoo fcc8bd2c83 Merge main into fix/blob-params-rejected 2026-11-15 20:51:54 -08:00
dotCooCoo 033b494836 Merge main into feat/stylus-wheel 2026-11-15 20:46:32 -08:00
yoriswind 14972b7667 M2: keep erased contours in their clipping mask 2026-11-15 19:49:07 -08:00