Commit Graph
11 Commits
Author SHA1 Message Date
dotCooCoo bb56fd7d23 Fill Area: a click adds a path of the enclosed area and keeps the paths around it
A new Fill Area tool in the Live Paint Bucket's group adds a closed path of
the area under a click, with the current fill, stroke and stroke weight. The
paths that bound the area are not changed, and nothing needs to be selected:
visible, unlocked paths on every layer bound areas, open paths and the
overlap of filled shapes included. The area under the pointer is outlined in
red while the pointer is over it, and a click outside every area does nothing
and records no undo step. The path appears on the press and is kept on the
release; Escape or a canceled touch before the release takes it back.

The new path goes directly above the front-most object along the area. When
a group, Live Paint group or clipping group holds that object, the path goes
above the outermost group in its layer, not inside it.

The tool sends the new shapeBuilder.copyRegion command (point, ids, gap,
openFilledAsClosed, fill, stroke). It uses the Shape Builder's Gap Detection
and Consider Open Filled Paths as Closed, and a double-click opens the Shape
Builder Tool Options. The area search maps the paths near the point first and
widens the window a few times before it maps every path. When a window's
paths have more segments than one Shape Builder map takes, the paths with the
most segments are left out, and an area is taken only when none of them
reaches it. When all the paths together have more segments than that, only
an area the nearby paths enclose is found. In a document of more than 128
segments the hover search runs on another thread, and the outline of an area
goes when the document changes under a still pointer.

Docs: docs/mcp.md, docs/target-app-parity.md, cursors.toml and the regenerated
UI command catalog. Catalog rows for the tool, its undo step and its message.
2026-11-15 15:22:30 -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 cf5ed86729 Merge main into fix/shape-builder-merge-off-ui-thread 2026-10-29 03:59:34 -07:00
bflatastic 828d784c8c Shape Builder: import replace_leaves in buildcmds/shape_builder.rs (#4299 made the imports explicit) 2026-10-29 13:00:46 +07:00
dotCooCoo f30819b7eb Shape Builder: a merge replaces only the paths it uses, where they are
Squashed from #4094 onto main.
2026-10-29 13:00:46 +07:00
dotCooCoo 963346984e Shape Builder: import find_command and drop the unused SubPath import after merging main 2026-10-28 17:42:35 -07:00
dotCooCoo 83748190f6 Shape Builder: import waits_for_tool_edit and Arc after merging main
main moved session/execute.rs and cmd/buildcmds/shape_builder.rs off glob
imports, so the branch's new waits_for_tool_edit guard and Arc::ptr_eq call
needed those names added to the explicit import lists.
2026-10-28 17:15:07 -07:00
dotCooCoo 72569ee6a4 Merge main into fix/shape-builder-merge-off-ui-thread 2026-10-28 16:48:55 -07:00
Dylan M. Taylor 7043ef6f3d Extract geometry command helpers 2026-10-28 16:44:11 +00:00
dotCooCoo 93677c26ec Shape Builder: a large selection merges on another thread
A Shape Builder click or drag over a selection of more than 128
segments merged on the UI thread, so the app stopped drawing and
answering until the merge was done. The tool now computes such a
merge on another thread from the map it built for the hover.
Meanwhile the canvas keeps drawing, the touched regions stay
highlighted and the pointer is the busy pointer. When the merge is
done, the tool runs shapeBuilder.merge with the gesture's params as
one undo step, and the command takes the computed shapes when it
would compute the same ones. The web build merges in the command, as
before.

A press while the map is still being built no longer waits for it on
the UI thread: the tool records the gesture and makes it once the map
is there.

Clicks, drags and the Shape Builder's arrow keys made during the
merge, and commands, menu items, the app's own dialogs, saves and tool
or document switches, run after it on the merged art; engine queries
that only read run at once. A change to the selected paths made
outside a command drops the merge. The headless host and ui.pointer
reply once the merge is applied.

The Shape Builder and the Live Paint Bucket keep their map of the
selection over a new revision of the document when the selected paths
and their outlines are unchanged, instead of building it again.
2026-10-27 17:26:38 -07:00
aiongg c2ead918b1 refactor(engine): move cmd/buildcmds.rs items to cmd/buildcmds/{live_paint,shape_builder,trace}.rs 2026-10-26 22:01:25 +00:00