Commit Graph
3 Commits
Author SHA1 Message Date
dotCooCoo e0ae990abc Live Paint: the Eyedropper, overprint, proxies and contents edits follow the whole-group rule
Follows #8685. The Eyedropper (appearance.copyFrom) onto a whole
selected Live Paint group, or reversed onto a clicked one, wrote the
picked appearance to every face, every edge and the hidden source
paths. It now gives the fill attributes to the faces and the stroke
attributes to the edges, and the source paths keep their paint. A
whole-appearance pick gives each face every picked fill row and each
edge every picked stroke row, and their other rows keep their order.
With append, the faces and edges take the picked rows but not the
picked object effects. A whole group picked up as the source gives
its first face's fills with its first edge's strokes above them, and
the group's own opacity, blend mode and effects.

Appearance edits with target "contents" also reached the source paths
and the parts of the other kind. The source paths are now left out of
a Live Paint group's contents. appearance.addFill adds a fill to the
faces only, and appearance.addStroke adds a stroke to the edges only.
A fill or stroke edit of the contents with an item (stroke.set,
paint.invert, paint.complement, gradient edits and
object.setOverprint) goes to the parts of its kind. Overprint Fill
and Overprint Stroke on a whole group also go to the faces and the
edges.

The Fill proxy and the Stroke panel showed a face's or edge's own
paint when it was selected before its group. A part selected with its
group, or with a group that holds its Live Paint group, now counts
with the group, whatever the selection order.

Docs: docs/mcp.md, params text, docs/target-app-parity.md.
2026-11-19 10:15:49 -08:00
dotCooCoo 42766fea24 Live Paint: a fill given to a whole group paints its faces and a stroke paints its edges
With a tool other than the Live Paint Bucket, a fill given to a whole
selected Live Paint group paints its faces only and a stroke paints its
edges only, instead of applying to the group as a whole. The hidden
source paths keep their paint.

- paint.setFill, paint.setStroke, paint.none, paint.lastColor,
  paint.lastGradient, paint.editGradient, paint.setGradientGeom, the
  paint.freeform point and line edits, paint.invert and
  paint.complement go to the faces for a fill and the edges for a
  stroke, also for a group given in ids or inside a selected group.
- stroke.set, stroke.weightUp, stroke.weightDown and stroke.setAdvanced
  change the edges.
- The Fill proxy shows the faces' fill, and the Stroke proxy, the Stroke
  panel and the Control bar show the edges' stroke. When the first
  selected object is a Live Paint group with no faces (or no edges),
  they show the next selected object's paint.
- paint.swap gives the faces the stroke the edges share and gives the
  edges the fill the faces share, with a gradient fitted to each face
  or edge. A group whose faces' fills or edges' strokes differ, or that
  has no face or no edge, is left as it is.
- paint.default leaves the faces with no fill and gives the edges a
  0.5 pt black stroke; with only Live Paint groups selected, the
  settings for new art take the same.

Docs: docs/mcp.md (Live Paint), docs/target-app-parity.md (Live Paint
evidence), params text of the changed commands.
2026-11-19 01:06:55 -08:00
dotCooCoo 0602c437da Color: the Fill and Stroke proxies find the selected objects through the id cache
DocState::proxy_mixed, which decides whether the Fill and Stroke proxies
show "?", walked every node of the document to find the selected
objects, even with one object selected. The Tools panel proxies, the
paint chips and the task bar ask for it on every frame whose revision
changed, which includes each frame of a drag preview, and new art asks
for it after a selection change.

Document::nodes_in_order finds every node with one of the given ids in
tree order. When the id cache holds each id once at a path that still
checks out, it reads the nodes along those paths; otherwise, and for a
selection of an eighth of the document or more, it walks the tree once,
as before. Unlike Document::index_paths it returns every node with a
repeated id, so a damaged file that repeats an id keeps the question
marks it had. proxy_mixed now gathers the selected objects through it.

Tests compare the result with a copy of the old walk for one object,
different fills and strokes, a group, a group with one of its objects,
two layers, a hidden object, Appearance items, picked gradient mesh
points beside another object, ids not in the document and a repeated id
with different paints, with the cache built and dropped, and for 200
random selections. A cost test shows that with one object selected only
that object is read and the tree is not walked. Document tests compare
nodes_in_order with a walk.

The gain shows on large documents. On 50,000 rectangles in 500 groups
on 5 layers (release build on Linux, thread CPU time, median of seven
alternating runs of both versions in one process; an ignored test,
proxy_mixed_timing, times them):

  Selection                    old       new
  1 object                     995 us    under 5 us
  2 objects, different fills   810 us    under 5 us
  a group of 100               875 us    5 us
  all 500 groups               3,615 us  2,575 us
  all 50,000 objects           4,075 us  3,470 us
2026-11-17 19:02:15 -08:00