Commit Graph
65 Commits
Author SHA1 Message Date
dotCooCoo 65b2129138 Live Paint: livePaint.strokeEdge refuses a through id that is not one of the group's edges
`through` now takes only the ids of the group's edges, each once: a face's
id, an unknown id, another group's edge or an edge given twice is an error
and changes nothing. A hidden edge in it is still skipped by the join. For
a double-click the Bucket passes only edges of the group, each once, so an
earlier click that filled a face whose fill was the edge's stroke paint
(Paint Fills and Paint Strokes both on) no longer sends that face.

The Bucket finds the faces a fill drag crossed among those whose bounds
meet the drag's bounds only.

A canvas test covers the middle-button press and the Space-held press
between two Bucket clicks. The progress-doc line lists the new tests, and
docs/mcp.md says which edges the tool passes in `through`.

Follows #7875.
2026-11-15 09:00:15 -08:00
dotCooCoo d86c9871c6 Live Paint: a triple-click after a release across an edge matches the fill from before it
When a click's press lands in one face and its release in the next, the
drag fills both. The bucket now notes the fill every face the drag
crosses had before the press, the release included, so a double-click
or triple-click that follows on such a face compares that fill instead
of the one the first click gave it. This also holds when the release of
the last click crosses into the clicked face.

When the first click makes the Live Paint group, or merges the selection
into a selected group, the crossed face counts with the fill it was made
with: a kept face's paint from the merged group (an unplaced gradient
fixed to its fit), else the fill Make gives it, the topmost fill that
draws of the front-most source path over it that has one. A selected
group's edges no longer count as source paths.

A double-click whose two clicks land on two joined edges now paints the
edges joined through the other edge its clicks painted:
livePaint.strokeEdge takes `through`, edge ids that the join counts as
drawing with `match`, and the tool passes that edge. When the second
press lands on the next edge and is released back on the first, the
double-click matches the first edge's stroke paint from before the
first click.

A press that the view tools take (held Space, the middle button), or
that holds Cmd/Ctrl and goes to the lent selection tool, now counts as
a press that paints nothing, so the clicks around it are not taken for
one triple-click's: the session tells the tool through the new
Tool::press_elsewhere.

The tool doc, docs/mcp.md and the progress-doc line now say that a click
records an undo step only when it changes a paint, and that a
triple-click paints the faces that have the clicked face's fill (and the
edges that draw with the clicked edge's stroke paint) with the bucket's
paint.

Follows #7291.
2026-11-15 07:19:56 -08:00
BFlat e5951a7dfe Merge pull request #7815 from dotCooCoo/fix/a-reverted-document-keeps-its-uid-so-a-trace
Image Trace: a trace started before Revert does not apply after it
2026-11-15 17:30:52 +07:00
BFlat 4a8db16419 Merge pull request #7816 from dotCooCoo/fix/bucket-strokeedge-and-livepaint-info-act-on
Live Paint: the Bucket replaces every fill or stroke row of a face or edge
2026-11-15 16:40:12 +07:00
dotCooCoo 63dab14ee7 Image Trace: Abutting traces draw seam fills under their paths
An Abutting trace with Fills now holds a "Seam Fills" group under its
paths. For each color it has one stroke, 1.5 image pixels wide, along
the edges where a filled path of that color meets a filled path drawn
after it, in that color. A renderer that anti-aliases each path on its
own no longer shows a light hairline along those edges. The traced
paths and their shared edges do not change, and edges against the
image's border, a transparent area or a color left out get no stroke.

- vectorcraft-trace: `seam_fills` finds the segments two filled paths
  share and strokes them in the lower path's color (one stroke per
  gradient path). Overlapping, traces without Fills and Flat Logo get
  none.
- Image Trace commands: the group comes under every path (right above
  the hidden image in a live trace). Expand keeps it, Expand by color
  leaves it under the color groups, and a trace whose paths have more
  than half of the anchor limit gets no seam fills.

Docs: docs/mcp.md, the params text, docs/target-app-parity.md.
2026-11-14 23:15:50 -08:00
dotCooCoo 872d870b5e Merge main into fix/bucket-strokeedge-and-livepaint-info-act-on 2026-11-14 20:32:43 -08:00
dotCooCoo dfe95278d3 Merge main into fix/a-reverted-document-keeps-its-uid-so-a-trace 2026-11-14 20:13:20 -08:00
BFlat 55c2bb5194 Merge pull request #7511 from dotCooCoo/fix/live-paint-make-drawn-rows
Live Paint: Make keeps every fill and stroke row that draws on the source
2026-11-15 09:46:20 +07:00
dotCooCoo 64f1ba414f Live Paint: the bucket replaces every fill or stroke row of a face or edge
livePaint.fill set only a face's topmost fill, and livePaint.strokeEdge
only an edge's topmost shown stroke. A lower fill or stroke kept drawing
under the new paint, a fill or stroke of none left it drawing, and a
hidden or half-transparent top row with the paint stopped the click.

The bucket now replaces every fill of a face, or every stroke of an
edge, with one row of the paint, shown, fully opaque and blending
normally, in the place of the topmost row of that kind. The row keeps
the dashes, caps, arrowheads and effects of the topmost shown row. The
face's strokes, the edge's fills and the part's own opacity stay as
they are. A click changes nothing, with no undo step, only when the
part already has that one row. This changes the earlier rule that kept
an edge's hidden strokes. The help page says the tool paints faces with
the current fill and edges with the current stroke; the row rule is
VectorCraft's own.
2026-11-14 18:43:38 -08:00
dotCooCoo 8d5a76b342 Image Trace: a trace started before Revert does not apply after it
File > Revert keeps the document's tab and uid, so a trace prepared
before the revert compared equal to one prepared after it when the
restored image, object and settings were the same. A background trace
that finished after the revert then applied to the restored content, and
a result handed to imageTrace.make or imageTrace.makeAndExpand stood in
for a fresh trace.

The trace inputs now record the document's revert count. A run prepared
before a revert is no longer current, the commands drop its result and
trace the restored image again as one undo step, and the status bar says
"Image Trace finished, but its document was reverted: trace it again".
Reverting another document, or a revert that fails, does not affect the
run.
2026-11-14 17:09:50 -08:00
dotCooCoo 8cba5fae0c Merge main into fix/live-paint-make-drawn-rows 2026-11-14 16:37:54 -08:00
dotCooCoo 67fd1cd127 Merge main into feat/live-paint-bucket-multi-click 2026-11-14 15:48:45 -08:00
BFlat 5872e71651 Merge pull request #7452 from dotCooCoo/feat/trace-preset-defaults
Image Trace: presets trace at Paths 50 with new Corners and Noise
2026-11-15 06:17:23 +07:00
dotCooCoo de5a46a2ab Live Paint: Merge keeps a painted edge's look on every piece an added path cuts
Merge carried each old edge's paint only to the new edge nearest the old
edge's middle, so when an added path cut a repainted edge, the other
piece went back to its source's stroke. Every new edge whose middle lies
on an old edge now takes that edge's paint, with its rows fitted to its
part of the edge, as Gap Options does.
2026-11-14 14:56:41 -08:00
dotCooCoo 09110ce7bf Live Paint: Merge fits a carried edge look to the piece it lands on
When Merge added a path that cut a painted edge, the piece holding the
old edge's middle took the old edge's stroke rows unchanged, so its
dashes started again and it kept both arrowheads. It now takes them
fitted to its part of the old edge, as Gap Options does.
2026-11-14 13:15:07 -08:00
dotCooCoo 0e6e7df695 Merge main into feat/live-paint-bucket-multi-click 2026-11-14 13:02:52 -08:00
dotCooCoo 44f8c41a15 Merge main into feat/trace-preset-defaults 2026-11-14 12:48:25 -08:00
dotCooCoo ec5472f726 Merge main into fix/shape-builder-open-path-drawn-fill 2026-11-14 12:38:20 -08:00
dotCooCoo f46e0ad809 Live Paint: the bucket paints the stroke an edge shows
livePaint.strokeEdge wrote the paint and weight into an edge's topmost
stroke even when that stroke was hidden. An edge whose hidden top stroke
sat over a drawn one kept drawing its old paint, and since the edge
scopes now match the paint an edge draws, a samePaint or connected
stroke reached such edges and changed nothing on screen. The command now
paints the topmost stroke that is shown, and adds a stroke above the
others when every stroke is hidden or there is none. The "nothing
changes" check reads the same stroke.

The doc comments of the scopes and of the press record describe the
drawn stroke paint, and the engine names Paint through its parent module
instead of in the import list. Live Paint Selection's comment on a
triple-click states that the tool takes no action on it.

New tests cover the edge the tool matches on a multi-click over a hidden
or fully transparent edge, the connected edge scope through transparent
and hidden edges, and painting the shown stroke.
2026-11-14 12:20:03 -08:00
dotCooCoo 7ef603db40 Live Paint: bucket scopes follow the stroke an edge draws
The Live Paint Bucket's connected and samePaint scopes kept their own
copies of the face flood and the edge walk. They read an edge's stored
stroke paint, so an edge that is fully transparent or whose stroke is
hidden stopped a face flood and matched as stroked. The face flood also
required outlines within 0.0001 pt of an edge, which a curved face that
the planar map refits can miss.

The engine now calls the shared flood_faces and connected_edges that
Live Paint Selection uses (#7342), and compares edges by lp_stroke_paint,
the paint of the topmost stroke that draws. The tool records that same
paint as the match for a double-click or triple-click on an edge. The
params text and docs/mcp.md describe the drawn stroke paint.
2026-11-14 11:24:56 -08:00
dotCooCoo 69ce720e46 Live Paint: Live Paint Selection does nothing on a triple-click
main's Live Paint Selection double-click (#7342) replaced the tool's
catch-all pointer arm with an explicit DoubleClick arm, so the
TripleClick kind this branch adds left the match non-exhaustive. The
tool now takes no action on TripleClick: the third click's press and
release already select what a click selects, as before the merge.

The merge also took main's import list in the engine's Live Paint
commands, which no longer named Paint while this branch's Merge code
still uses it; Paint is imported again.
2026-11-14 10:44:26 -08:00
dotCooCoo 1c4cc88e90 Merge main into feat/live-paint-bucket-multi-click
# Conflicts:
#	crates/tools/src/builder/live_paint.rs
2026-11-14 10:19:24 -08:00
dotCooCoo bbe9480656 Shape Builder: an open path counts as filled by the fill rows that draw
Consider Open Filled Paths as Closed decided whether an open path was
filled from its top fill row only. A path whose top fill is None over a
painted lower fill stayed open, and one whose only painted fill was
hidden or at 0% opacity closed. The region map, merge inputs and the
Clicking Stroke Splits the Path cut now use Appearance::has_drawn_fill,
so any shown, painted fill row above 0% opacity counts, as the canvas
paints it.

The Shape Builder's Live Paint face and edge filters had the same
top-row check; they now use has_drawn_fill and has_drawn_stroke, so a
face or edge is taken when one of its rows draws.
2026-11-14 08:00:35 -08:00
dotCooCoo 10f94b544d MCP: livePaint.info lists every appearance row of a face or edge
livePaint.info reported only the top fill of each face and the top
stroke and weight of each edge, so a lower row that draws under an
unpainted top row was not visible to a client. Each face and edge now
also carries `appearance`: every fill and stroke row, bottom first, as
{index, kind, paint, opacity, visible, width (strokes only), drawn}.
`drawn` follows Expand's rule row by row: the part is shown with an
opacity above 0, and the row is shown, has paint and an opacity above
0, and a stroke has a weight above 0. The existing `fill`, `stroke`,
`width`, `bounds`, `sources`, `gapOptions` and `gaps` fields are
unchanged.

The params text no longer says the group defaults to the selection:
the command takes `group`, or `id` when `group` is left out, and
returns an error without either.
2026-11-14 07:57:56 -08:00
BFlat 66d24335e1 Merge pull request #7599 from dotCooCoo/fix/trace-hand-in-same-document
Image Trace: a finished trace is applied only to the document it was made in
2026-11-14 21:54:04 +07:00
dotCooCoo 01359bc753 Image Trace: a trace made off the UI thread applies only in its own document
A trace handed in for imageTrace.make or imageTrace.makeAndExpand was
matched by its object, image, pixels and settings alone, so a trace made
in one document could stand in for the command in another open document
with the same image and settings. The trace's inputs now carry the
document's uid: TraceRun::current is false in any other document, and the
commands there drop the trace handed in and trace their own image, as one
undo step.

Test: a_trace_run_applies_only_in_its_own_document.
2026-11-14 05:11:34 -08:00
dotCooCoo 090293db4e Image Trace: preset docs name the enhanced versions and older figures
The preset paragraphs say that the enhanced versions use the same Paths,
Corners and Noise, and that Corners 50 applies to the other eight
presets. The quality notes add the staircase and anchor rises in Line
Art, Outline, 3 Colors, Sketched Art and Silhouettes, and say which
figures were measured at the earlier values. The anchor-limit comments
name the same settings in both places.
2026-11-13 21:22:12 -08:00
dotCooCoo 6027126a1f Merge main into feat/trace-preset-defaults 2026-11-13 20:19:30 -08:00
dotCooCoo 9b2e21f6ca Live Paint: Merge keeps the visibility, opacity and blending of the parts it carries
Merge copied a face's or edge's appearance to the part it rebuilds in its
place, but not its visibility, opacity or blending mode. A half-transparent
face drawn by its stroke became opaque, and a hidden edge was shown again.
2026-11-13 20:14:37 -08:00
dotCooCoo 1f6332c0a4 Live Paint: Expand keeps the faces and edges that draw
Expand kept a face only when its topmost fill had paint, and an edge only
when its topmost stroke had paint and a weight. A face or edge drawn by a
lower row under an unpainted top row was removed, and one whose only
painted row was hidden was kept as a visible path.

Expand now keeps a face or edge when it is shown, its opacity is above 0,
and any fill or stroke row is shown, has paint and an opacity above 0 (a
stroke also a weight above 0), with all of its rows. The rows are checked
with the new Appearance::has_drawn_fill and has_drawn_stroke.

Merge carried a face's topmost fill paint by the same topmost-row test.
It now carries every row of each face that draws by this rule, and of
each edge, pins their unplaced gradients to the old outline as
repaint_from does, and leaves the strokes' pen pressure, tilt, bearing
and rotation behind, since the rebuilt parts are other paths.

Docs: livePaint.expand params text, docs/mcp.md, and a line in
docs/target-app-parity.md, which also drops a repeated Live Paint
Selection marquee line.
2026-11-13 19:17:21 -08:00
dotCooCoo 33319b2c4d Merge main into feat/live-paint-bucket-multi-click 2026-11-13 18:04:02 -08:00
dotCooCoo 4dd3809f84 Live Paint: triple-click test checks the face the planar map makes
The test for a triple-click whose first click makes the group now also
builds the planar map from the same two paths and checks that the face
at the click takes its fill from the square. The doc comment of the
double-click flood names the three points it checks along each edge
segment.
2026-11-13 17:43:37 -08:00
dotCooCoo 815c772a46 Image Trace: presets trace at Paths 50 with new Corners and Noise
Every built-in preset other than Auto Color and Flat Logo now traces at
Paths 50. Corners is 100 in Technical Drawing, 75 in Default, Black and
White Logo, Line Art and Outline, and 50 in the others. Noise is 1 px in
Technical Drawing, 5 in High Fidelity Photo, 10 in Low Fidelity Photo, 15
in 3 Colors, 6 Colors, 16 Colors and Shades of Gray, 20 in Sketched Art,
Line Art and Outline, 25 in Default and Black and White Logo, and 90 in
Silhouettes. Palettes, color counts and the other options are unchanged.

This changes the output of every preset but Default, Auto Color and Flat
Logo. The traces take fewer anchors (High Fidelity Photo 5,494 to 3,136
and Black and White Logo 27 to 14 in crates/trace/tests/quality), and
outlines on flat art lie further from the true edge (16 Colors 0.100 to
0.123 px off on average).

Docs: docs/image-trace-adjustments.md, docs/image-trace-quality.md,
docs/target-app-parity.md.
2026-11-13 17:13:52 -08:00
dotCooCoo 52aec70e19 Live Paint: double-click floods along split edges, triple-click on new art skips open paths
- A face outline segment that runs along several edge segments (the
  face has no corner where a crossing line splits the edge) now joins
  the face to every edge segment it runs along, not only the one under
  its middle, so a double-click flood no longer stops there.
- The first click of a triple-click on selected paths, which makes the
  Live Paint group, takes the fill to match from the paths' closed
  subpaths only, as the group's faces do; an open path in front no
  longer gives the wrong fill.
2026-11-13 17:05:06 -08:00
dotCooCoo c477db87ba Live Paint: an edit that changes nothing records no undo step
A Live Paint Bucket click or drag over faces that already have the
fill, a stroke on an edge that already has the paint and width, Gap
Options with the options the groups have and no gap to close, and Make
or Merge given one Live Paint group alone now leave the document, the
undo and redo steps and the saved state as they are, and reply as
usual. Such a fill or stroke also leaves the recent colors as they are.

Gap Options with Close Gaps With Paths makes a group's faces again only
when it adds a path or what paint stops at changes, so the faces keep
their ids otherwise.
2026-11-13 15:39:04 -08:00
dotCooCoo f9e796cb10 Live Paint: double-click floods across unstroked edges, triple-click paints the same paint
With the Live Paint Bucket, a double-click on a face fills it and every
face reached across edges that are hidden or draw no stroke; a stroked
edge, a hidden face and a Gap Detection gap stop it. On an edge, a
double-click paints the edges joined to it end to end with the same
stroke paint. A triple-click fills every face of the group with the
clicked face's fill, or paints every edge with the clicked edge's
stroke. Shift and the Paint Fills and Paint Strokes options choose a
face or an edge as for a click; Alt held paints nothing.

- livePaint.fill and livePaint.strokeEdge take scope ("one", the
  default, "connected" or "samePaint") and match, the paint compared,
  and reply with count. A bad scope or match is an error, and scope
  with a drag's points is refused.
- Each click of a double-click or triple-click paints as it arrives,
  as its own undo step. For a triple-click, and for a double-click on
  an edge, the tool sends as match the paint the face or edge had
  before the first of those clicks, including a first click that makes
  the Live Paint group from the selected paths. A double-click on a
  face sends no match.
- PointerKind::TripleClick is new: the canvas sends it on egui's
  triple-click unless a modal dialog is open, as for a double-click,
  and ui.pointer and pointer_gesture take "tripleclick".

Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md.
2026-11-13 13:01:02 -08:00
dotCooCoo 08e1b7af80 Image Trace: a background trace applies only to the pixels it traced
A trace made away from its command (the background trace, #3098) counted
as current when the object, its image record and the settings were
unchanged, without looking at the image data. When other pixels came to
sit under the same image key (Rasterize after an undo reuses the key and
the id, Update Link, a replaced blob), the finished trace applied its old
paths to the new image.

The trace's inputs now include the encoded bytes it decodes, compared by
allocation first and then by content. TraceRun::current and the hand-off
in imageTrace.make and imageTrace.makeAndExpand both use them, so a stale
trace is dropped and the command traces the pixels there now. Equal bytes
in another allocation still count as the same image.
2026-11-13 07:18:53 -08:00
dotCooCoo 19d2778337 Merge main into fix/malformed-id-not-missing 2026-11-11 23:31:01 -08:00
makesomethingshit dfa8403ed0 Fix #6373: Keep painting through long Live Paint drags 2026-11-12 13:46:51 +09:00
dotCooCoo 5c2e182388 MCP: a malformed object id is refused as such, not reported as missing
Commands that need an object id read it with `id_param`, which returns
None for a value that is not a non-negative integer, so `{"id": "5"}` or
`{"id": -1}` was refused with "missing id". They now read it with
`object_param`, which refuses such a value with "`id` must be a whole
number", naming the key. This covers `document.node`, the `path.*` anchor
and handle commands, the `text.*` range and path commands, the mesh,
envelope and slice point commands, `layer.target`, `layer.move`,
`node.move`, `select.magicWand`, and the `source`, `target`, `group` and
`path` keys of `appearance.transfer`, `appearance.copyFrom`, the
`livePaint.*` commands and `text.createInPath`.

The optional `group` of `livePaint.fill` and `parent` of `node.move` are
refused the same way when given. Before, a malformed `parent` moved the
object to the top level and a malformed `group` fell back to the
selection.
2026-11-11 12:47:49 -08:00
makesomethingshit 2fd5076842 Fix #6373: Live Paint Bucket fills faces crossed by a drag 2026-11-12 01:42:41 +09:00
dotCooCoo fc728b909e Merge main into fix/shape-builder-merge-off-ui-thread 2026-11-08 20:23:21 -08:00
dotCooCoo fd3482c272 Merge main into fix/shape-builder-merge-off-ui-thread 2026-11-08 11:28:00 -08:00
dotCooCoo 0f926b571f Merge main into feat/trace-keep-colors 2026-11-08 10:58:31 -08:00
dotCooCoo f118cf6aa6 Image Trace: Expand can group the traced paths by color
Squashed from #4058 onto main.
2026-11-08 23:50:26 +07:00
dotCooCoo f4ee10b2ec Merge main into feat/trace-keep-colors 2026-11-02 01:25:05 -08:00
dotCooCoo 05ac9ce040 Merge main into fix/shape-builder-merge-off-ui-thread 2026-11-01 22:20:23 -08:00
dotCooCoo 462b7cca15 Image Trace: Document Library fills are not linked to swatches
With Document Swatches as the library, traced fills and strokes take the
library color without a swatch link. Global, spot and tint swatches no
longer link the trace, so editing a swatch later leaves the trace
unchanged, and swatch order no longer decides whether a fill is linked.
Each region still takes the nearest library color, and a tint traces at
the color the tint swatch shows.
2026-10-31 07:17:08 +07:00
dotCooCoo a2d3841579 Image Trace: look up library swatches once per trace
Each traced path filtered the whole library for its color, twice when
no swatch of that color was linked. The color-to-paint lookup is now
built once before the paths are filled. The first linked swatch of a
color still gives the fill, and the first swatch of that color
otherwise.
2026-10-30 23:57:40 +07:00
dotCooCoo 65f7d3a699 Image Trace: Document Library links to a global swatch that shares a process swatch's color
When a process swatch listed before a global or spot swatch showed the
same color, a traced fill of that color took the process swatch and
stayed unlinked. Of the swatches that trace as one color, the first
linked one now gives the fill, and the first one otherwise.
2026-10-30 23:57:40 +07:00