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.
This commit is contained in:
dotCooCoo
2026-11-15 15:22:30 -08:00
parent 8ee5acc04e
commit bb56fd7d23
48 changed files with 1308 additions and 18 deletions
+25 -2
View File
@@ -2024,7 +2024,7 @@ and `type.fractionalWidths`; `flip` in `type.dynamicTextPreset`; `remove` and `o
`swatch.addUsedColors`; `visible` in `appearance.setItem`; `copy` in `appearance.transfer`; `reverse` and `append` in
`appearance.copyFrom`; `reverse` and `stroke` in `paint.editGradient`; `stroke` in `paint.setGradientGeom` and in
`paint.freeform.addPoint`, `setPoint`, `deletePoint`, `addLine`, `splitLine` and `get`; `erase`,
`openFilledAsClosed` and `splitStroke` in `shapeBuilder.merge`; `openFilledAsClosed` in `shapeBuilder.regions`; `closeGaps` in `livePaint.gapOptions`; and
`openFilledAsClosed` and `splitStroke` in `shapeBuilder.merge`; `openFilledAsClosed` in `shapeBuilder.regions` and `shapeBuilder.copyRegion`; `closeGaps` in `livePaint.gapOptions`; and
`enhanced` in `imageTrace.make` and `imageTrace.makeAndExpand`. A null is read as a key left out.
These commands refuse a string or another value that is not a number with `` `radius` must be a number, not "2" ``,
@@ -2043,7 +2043,7 @@ and `fitMinPercent` in `text.areaOptions`; `x` and `y` in `symbol.place`; `radiu
`symbol.spray`; `radius` and `intensity` in `symbol.adjust`; `to` in `swatch.move`; `weight` and `opacity` in
`appearance.setItem`; `r`, `g`, `b`, `c`, `m`, `y`, `k`, `gray` and `tint` in `edit.colors.adjustBalance`; `steps`
and `amount` in `color.harmony`; `angle` in `paint.editGradient` and in the `gradient` of a command that takes a paint; `t` in
`paint.freeform.splitLine`; `tolerance` and `gap` in `shapeBuilder.merge`; `gap` in `shapeBuilder.regions`; and
`paint.freeform.splitLine`; `tolerance` and `gap` in `shapeBuilder.merge`; `gap` in `shapeBuilder.regions` and `shapeBuilder.copyRegion`; and
`width` and `tolerance` in `livePaint.strokeEdge`. A null is read as a key left out. A gradient stop that names a
swatch refuses a `tint` that is not a number with `` stop 0: `tint` must be a number ``.
@@ -11032,6 +11032,29 @@ a stroke when it has `rect`. With both `rect` and `points`, the command also tou
{"name":"run_command","arguments":{"command":"shapeBuilder.merge","params":{"rect":[50,50,200,200]}}}
```
The Fill Area tool (`fillArea`, in the Live Paint Bucket's group) adds a new closed path of the area under a click
and leaves the paths around it as they are. Nothing needs to be selected: the visible, unlocked paths on every layer
bound areas, filled or not, open paths included, and the overlap of two filled shapes is an area of its own. While the
pointer hovers an area, the tool outlines it in red and the pointer shows the bucket with paint; elsewhere the pointer
shows the empty bucket, and a click there does nothing. The new path appears on the press and is kept on the release;
Escape or a canceled touch before the release takes it back. In a document of more than 128 path segments the tool looks
for the hovered area on another thread, and the outline appears when that search is done. The tool sends `shapeBuilder.copyRegion` with `point`, the Shape Builder's gap
length (`gap`, 0 with Gap Detection off) and its `openFilledAsClosed`: the two tools share `gapDetection`, `gapLength`
and `openFilledAsClosed`, so `tool.setOption` on either one sets them for both, and `fillArea` has no other options.
Double-clicking the Fill Area tool opens the Shape Builder Tool Options (`tool.options {tool: "fillArea"}`, dialog
`shapeBuilderOptions`).
The new path takes the current fill, stroke and stroke weight (`fill` and `stroke` override the paints), goes directly
above the front-most object along the area (one whose outline touches the area's outline, or that covers it) and is
selected. When a group, Live Paint group, Shaper group or clipping group holds that object, the new path goes above the
outermost group in its layer, not inside it, and the group keeps its members. A point in no enclosed area is the error "Fill Area: no enclosed area under the pointer" and records no undo
step; a `gap` outside 0 to 72 is an error. It returns `{id, above}`. The command looks for the area among the paths
near the point first. When the paths together have more than 65,536 segments and the paths near the point do not
enclose it, the point counts as in no enclosed area.
```json
{"name":"run_command","arguments":{"command":"shapeBuilder.copyRegion","params":{"point":[50,70],"gap":3}}}
```
## Perspective grid
The grid is document data (`perspective.grid.set` edits the model directly). `perspective.grid.get` reads it: