mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-24 22:34:09 +00:00
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:
+25
-2
@@ -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:
|
||||
|
||||
@@ -1267,6 +1267,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
As VectorCraft's own rule, OK in Shape Builder Tool Options gives an error for a highlight Color with an alpha part (`#rrggbbaa` or `#rgba`) and changes nothing. Regression test: `dialogs::shape_builder_options::tests::a_highlight_color_with_an_alpha_part_is_refused`.
|
||||
With Pick Color From Artwork, a merged shape takes the appearance, opacity and blending mode of the object where the drag starts, else of the object where it ends, else of the front-most selected object, as the [Shape Builder combine page](https://web.archive.org/web/20251006211643/https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/combine-shapes-with-shape-builder-tool.html) describes. A click in an area that no selected object covers, such as a hole other shapes enclose, takes the front-most selected object's look (`shapeBuilder.merge` `points`: the first point is where the drag starts, and the last point is where it ends).
|
||||
A Shift-drag with the Shape Builder tool draws a rectangular marquee for merging many paths at once, as [Combine shapes with the Shape Builder tool](https://web.archive.org/web/20251006211643/https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/combine-shapes-with-shape-builder-tool.html) describes: the regions it reaches are shaded while it is drawn and merge into one shape on release, or with Alt they are deleted. The marquee reaches each region whose outline crosses it or has an anchor inside it, and the region that holds the whole marquee; this rule is VectorCraft's own. For Pick Color From Artwork, the marquee's starting corner is where the drag starts and the opposite corner is where it ends (`shapeBuilder.merge` `rect`).
|
||||
As VectorCraft's own tool, Fill Area (in the Live Paint Bucket's group) adds a new closed path of the area under a click with the current fill and stroke, directly above the front-most object along it, and leaves the paths around it as they are. It needs no selection: the visible, unlocked paths on every layer bound areas, open paths and the overlap of filled shapes included, and it uses the Shape Builder's Gap Detection (`shapeBuilder.copyRegion`). Regression tests: `tests::fill_area::*`.
|
||||
Shape Builder pieces on dense hatches (lines at exact 0.25 or 0.5 pt steps across another line) come back one per stretch between crossings, with no speck where the sweep cut a line's two passes a rounding error apart: the planar map contracts the stub between such cuts into one vertex, bounded by each cluster's extent so a run of tiny level segments keeps its length (`crates/pathops/src/planar.rs` tests `a_dense_hatch_at_exact_binary_steps_cuts_each_line_once_per_crossing`, `a_run_of_tiny_level_segments_is_not_contracted_as_stubs`, `a_line_crossed_where_its_two_passes_part_is_cut_once`).
|
||||
The planar map's edge-source grid stays linear in memory on any input: a segment is filed once per cell it crosses, and the grid holds at most a budget of cell references (a few dozen per item plus a few rows' worth), past which the remaining items go to a short scanned list and are still found, so thousands of coincident segments cannot make the index quadratic (`crates/pathops/src/planar.rs` test `rect_index_holds_a_bounded_number_of_references`).
|
||||
The Blob Brush Tool Options have Keep selected and Merge only with selection, both off by default: while Keep selected is off, the blob a stroke draws or merges into is not selected afterwards, and while Merge only with selection is on, a stroke merges only with selected blobs of its color that it touches (`path.blob` `keepSelected` and `mergeOnlySelection`).
|
||||
|
||||
Reference in New Issue
Block a user