Commit Graph
187 Commits
Author SHA1 Message Date
dotCooCoo 781207af3b Merge main into fix/match-objects-guards 2026-12-04 10:48:37 -08:00
.CooCoo a6553e0a1a Merge pull request #10203 from dotCooCoo/fix/match-objects-size-edges
Match Objects: sizes fit after the turn, reach any scale and replay with their corner scaling
2026-12-04 10:15:10 -08:00
.CooCoo ddff0adfbf Merge pull request #10747 from dotCooCoo/feat/live-star-points
Shapes: stars stay live with an editable point count
2026-12-04 08:12:18 -08:00
.CooCoo a9ba1b3134 Merge pull request #10742 from dotCooCoo/fix/live-corners-anchor-edits
Live Corners: corners stay live after anchor moves
2026-12-04 07:12:48 -08:00
dotCooCoo b3f5c22633 Shapes: a live star keeps a small ratio and its corners through edits
A live star whose ratio is below 0.01, which object.setLiveShape takes,
lost its inner radius and its live shape when addon.shapes.configure
changed another value: the stored ratio was clamped to 0.01 when the
star was drawn and no longer counted as live. Any ratio from 0 to 1 now
draws and stays live as it is.

A corner list shorter than the star's or polygon's corners counted as
one shared radius, so a new point or side count gave the missing corners
the first corner's radius. The missing corners now stay sharp.

A ratio that changes which corners a rounded star cuts is now an error
with radius or kind in the same call, as points is, since the corners
selected before it no longer name the same corners. The anchor selection
is dropped by the same check.
2026-12-04 01:01:51 -08:00
dotCooCoo 4e4cf9caaf Merge main into fix/match-objects-guards 2026-12-03 10:59:49 -08:00
dotCooCoo 47fd44f4fb Merge main into fix/match-objects-size-edges 2026-12-03 10:44:24 -08:00
dotCooCoo 5eb3adea28 Live Corners: selection and key anchor follow every recut
The selected anchors and the key anchor of a path with rounded Live
Corners now follow its corners whenever the anchors as drawn change:
after a move recuts the corners, and after the pixel-grid snap of a
pixel-aligned path cuts them again. Before, the snap's recut left the
selection on the old indices, and the key anchor was never remapped.

- A move of selected anchors that the pixel-grid snap puts back where
  it was leaves the document unchanged and records no undo step.
- object.move and object.transform params text describe the recut of
  the uncut corners when they move direct-selected anchors.
2026-12-03 09:05:16 -08:00
dotCooCoo 5aadf6c616 Shapes: stars stay live with an editable point count
A star drawn with the Star tool, shape.star or addon.shapes.star was a
plain path, so its point count could not change after it was drawn.

- LiveShape::Star keeps the outer and inner radii, the point count
  (2 to 1000, clamped when read from a file) and Live Corners' radii and
  kinds. Its corners keep the radius they shared through a new count.
- object.setLiveShape takes `points` (2 to 1000) and `ratio` (inner
  radius over outer radius, above 0 and up to 1), one undo step each and
  none when nothing changes. A new layout drops the star's selected
  anchors and segments; `points` with `radius` or `kind` is an error.
- The side widget shows on a live star and sets 3 to 20 points.
- Star Properties in the Transform panel and the Properties panel's
  Transform section have a Points field with a 3 to 20 slider and a
  Ratio field.
- Shape Tools' configure keeps a whole star live.

Fixes #4339
2026-12-03 08:54:44 -08:00
.CooCoo 041c6cbfe9 Merge pull request #10660 from dotCooCoo/fix/newgroup-keeps-tracing
Image Trace: object.newGroup at index 0 no longer ends a tracing
2026-12-03 07:35:43 -08:00
.CooCoo 4ae9e3641d Merge pull request #10189 from dotCooCoo/fix/compound-release-opacity
Compound Paths: Make and Release keep the transparency and opacity mask
2026-12-03 07:19:37 -08:00
.CooCoo d5aef1fb90 Merge pull request #10154 from dotCooCoo/fix/offset-objects-pixel-snap-gap
Arrange Tools: Offset Objects chains pixel-aligned objects from where they snap
2026-12-03 07:18:54 -08:00
dotCooCoo d3eb174b6d Image Trace: object.newGroup at index 0 no longer ends a tracing
An Image Trace object keeps its source image as its first child. object.newGroup
with index 0 put the new group below that image, so the group stopped being a
tracing. Index 0 in an Image Trace object is now refused before anything
changes; index 1 puts the group directly above the source image.

The index parameter came with #9048.
2026-12-02 19:07:05 -08:00
dotCooCoo 9aa8eb3413 Merge main into fix/offset-objects-pixel-snap-gap 2026-12-01 07:18:49 -08:00
dotCooCoo 2d8843072d Merge main into fix/match-objects-size-edges 2026-12-01 06:48:35 -08:00
dotCooCoo ee1e5bf2e5 Merge main into feat/scripts-api-d3-layers-artboards 2026-11-30 21:04:45 -08:00
dotCooCoo 24bd70fa08 Merge main into feat/scripts-api-d3-layers-artboards 2026-11-30 11:45:53 -08:00
ljkxandClaude Opus 5.5 35eae6a235 Merge remote-tracking branch 'origin/main' into fine-nudge-5258
# Conflicts:
#	docs/ui-parity.md

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 17:00:35 +01:00
dotCooCoo d14a3682db Match Objects: sizes fit after the turn, reach any scale and replay with their corner scaling
Match Objects measured a target's new size before it was turned, refused
sizes that pixel-aligned art reaches before it snaps, and checked only
the requested side of a proportional match. A stroke or effect that does
not turn with the art, such as a Transform effect's copy, then made a
reachable size fail. Each target is now measured in the frame it ends
in, before pixel snapping, against both sides; when it misses, the
scales in that frame are fitted from the turned object and its
reference point is kept in place. A fit that leaves the target at its
old angle is refused.

The 1e-4 smallest scale of object.setBounds no longer applies, so a
20,000 pt object can be matched down to 1 pt.

Match Objects, Set Size of Each, Swap Objects, Replace with Top Object
and Sort Objects now pass the journaled Scale Corners (and Transform
Pattern Tiles) values to both the size solver and the transform, so a
replay scales corners as the run did.

Follows up #10072.
2026-11-30 06:00:56 -08:00
ljkxandClaude Opus 5.5 397cb9a472 Merge remote-tracking branch 'origin/main' into fine-nudge-5258
# Conflicts:
#	crates/engine/src/cmd/object/commands.rs
#	docs/ui-parity.md

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 13:58:07 +01:00
dotCooCoo e49b11ff4b Match Objects: check the reference point of turned pixel-aligned art after snapping
A turned target that is pixel-aligned, holds pixel-aligned art or holds an
instance of a pixel-aligned symbol is snapped to the pixel grid after the
match, which could move its reference point while the command succeeded.
Its reference point and matched dimensions are now checked after the snap,
with or without Use Preview Bounds, and the match is refused when either
moved. Only targets with a geometry effect are still moved back to their
measured point, so aligned art is not pushed off the grid.

The params text, docs/mcp.md and docs/target-app-parity.md state the
refusal.
2026-11-30 04:46:19 -08:00
dotCooCoo 04ced9bee7 Performance: the check of a moved selection reads the objects at their places
After a move, the check that a view can move the selection's marks
instead of building them again looked each moved object up by id three
times: the object, its parent's id and the parent. With 10,000 objects
selected that was 30,000 lookups after the edit. The check now keeps
each object's place from the transform and reads the object and its
parent there, so the move looks each object up once, as before.
2026-11-30 03:33:26 -08:00
dotCooCoo 18271017b7 Merge main into fix/move-many-selected 2026-11-30 02:41:35 -08:00
.CooCoo 006106a3cc Merge pull request #10141 from dotCooCoo/fix/selection-marks-move-translate
Canvas: a move of the selection moves its marks instead of building them again
2026-11-30 01:06:26 -08:00
dotCooCoo fc30737f73 Match Objects: sizes fit after the turn, reach any scale and replay with their corner scaling
Match Objects measured a target's new size before it was turned, refused
sizes that pixel-aligned art reaches before it snaps, and checked only
the requested side of a proportional match. A stroke or effect that does
not turn with the art, such as a Transform effect's copy, then made a
reachable size fail. Each target is now measured in the frame it ends
in, before pixel snapping, against both sides; when it misses, the
scales in that frame are fitted from the turned object and its
reference point is kept in place. A fit that leaves the target at its
old angle is refused.

The 1e-4 smallest scale of object.setBounds no longer applies, so a
20,000 pt object can be matched down to 1 pt.

Match Objects, Set Size of Each, Swap Objects, Replace with Top Object
and Sort Objects now pass the journaled Scale Corners (and Transform
Pattern Tiles) values to both the size solver and the transform, so a
replay scales corners as the run did.

Follows up #10072.
2026-11-29 23:21:26 -08:00
dotCooCoo a8ebdcedfd Compound Path: Release keeps a path's own opacity mask when the compound path has none
Release copied the compound path's transparency onto each path, mask included, so a
path in front that kept its own opacity mask through Make Compound Path lost it on
Release when the compound path had no mask.
2026-11-29 21:58:46 -08:00
dotCooCoo 51e0bfc3ce Compound Paths: Make and Release keep the transparency and opacity mask
Release Compound Path gave each released path the compound path's paint
but not its opacity, blend mode, Isolate Blending, Knockout Group,
Knockout Shape or opacity mask, so a compound path at 50% opacity
released into fully opaque, unmasked paths. Make Compound Path gave the
new compound path the backmost object's paint but left its transparency
at the defaults and dropped its opacity mask.

- Make gives the compound path the backmost object's transparency and
  opacity mask along with its paint. The backmost path hands its mask to
  the compound path rather than keeping a second copy.
- When the backmost path is inside a selected group, the group's
  transparency applies too: the opacities multiply, and the group's
  blend mode, Knockout Group and opacity mask apply where the path has
  none of its own. A group at 50% now makes a compound path at 50%
  instead of 100%.
- Release gives each released path the compound path's transparency
  and opacity mask. The first path keeps the mask art; each later path
  gets a copy of it with ids of its own.
- Copying a compound path's member uses the same helper for the
  transparency it takes from the compound path.

The params text of object.compoundPath.make and
object.compoundPath.release names the transparency carried.
2026-11-29 20:11:40 -08:00
dotCooCoo ec49f8ca5b Arrange Tools: Offset Objects measures an Objects on Path group with its members back on the path
A moved Objects on Path group puts its members back on the path, and on
the pixel grid, after the move. Offset Objects now measures the group's
trailing edge as that leaves it, on one copy of the document, so the
next object starts the gap past the group's final edge. The pass reuses
the pixel-aligned symbol transforms it already computed.
2026-11-29 17:56:49 -08:00
dotCooCoo 9a58807841 Performance: a move finds the selected objects' places in fewer walks of the tree
With 10,000 objects selected, object.move walked the document's tree five
times and looked each object up by id three times. It now walks the tree
three times and looks each object up once.

- The selected roots (for the menus, for Move, Rotate, Scale and the
  other transforms, for Copy and Cut, and inside an isolated group) are
  put in paint order and reduced to their top-level objects from one walk
  instead of two.
- A transform finds the objects' places once for Transform Patterns and
  for the edit, instead of once for each.
- After a transform, the check for a pixel-aligned compound path reads
  the parent at the object's place instead of looking the object and its
  parent up by id.
2026-11-29 16:44:27 -08:00
dotCooCoo 4522dbce61 Arrange Tools: Offset Objects chains pixel-aligned objects from where they snap
Offset Objects worked out every object's place from where the one
before it was sent, but an object aligned to the pixel grid snaps after
it moves. With pixel-aligned objects and a fractional gap the gaps came
out uneven (0, 0 and 1 pt for a 0.25 pt gap between four 10 pt squares).

Each object is now moved, snapped (natural-size instances of
pixel-aligned symbols too, outside a symbol's editing layer) and
measured again, and the next one starts from that edge. A run whose
objects all snap back where they were makes no undo step.

Fixes the Offset Objects command added in #10075.
Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-29 16:21:08 -08:00
dotCooCoo b816f072c1 Scripts: layer, artboard and scoped collection fixes
- A layer's, group's or compound path's collections and Artboard objects
  read before File > Revert throw their stale errors.
- Scoped PageItems answer index() by number.
- removeAll() refuses to delete a clipping path whose group or layer keeps
  other objects (ruler guides do not count), after the lock checks.
- Layers lists are kept while the document is unchanged, so a loop over
  layers[i] lists them once; getByName on scoped collections is charged
  each time.
- Action steps act on the artboard the script chose with
  setActiveArtboardIndex, or on its index when it was deleted.
- object.newGroup refuses null for parent, index and compound.
2026-11-29 15:08:19 -08:00
dotCooCoo 389fc65631 Canvas: a move of the selection moves its marks instead of building them again
The canvas kept the selection's outlines, anchors and dots only while the
document revision stayed the same, so every move command, nudge and drag
step built them again from every selected object. With 10,000 selected
rectangles one build took about 26 ms in a release build.

A move of whole objects now records the documents before and after it
and the distance (DocState::moved). The record is made only when each
moved object is still the node the transform left (no later pass, such
as the pixel grid snap, changed it), none is a member of a blend, and
every object the selection shows, the key object and the key anchor's
object included, is a moved object or inside one. Copies, scales, moves
of patterns alone and moves that resize type areas make no record.

The canvas moves its kept marks by that distance when the record names
the document they show, or the document a drag began with. It also keeps
them through a new revision of the same document and selection, as at
the end of a drag. Every other change builds them as before.
2026-11-29 14:09:19 -08:00
dotCooCoo aaa54f1307 Performance: an edit skips unchanged objects without reading them
After every edit, the pixel grid, color mask, Objects on Path, Shaper and
symbol instance passes, and the inline graphics refresh, pair each object
with its counterpart from before the edit. Each pass read both objects to
compare their ids before it found that they were the same node, so moving
one object in a layer of 20,000 objects read all of them in four passes.
The color mask pass is new since v0.24.1, and object.move became slower
than in that release.

The new vectorcraft_doc::changed_nodes does the pairing for all six. An
object that is the same node at the same position is skipped by a pointer
comparison; only changed and new objects are looked up by id.

object.move of one rectangle in a document of 20,000 objects, release
build, median CPU time of 2,000 moves: main 1.25 ms, this change 1.08 ms,
v0.24.1 1.06 ms. The passes' share of the move went from about 30% to 5%
in a profile.
2026-11-29 13:03:07 -08:00
dotCooCoo 3f27eace1c Merge main into feat/scripts-api-d3-layers-artboards
# Conflicts:
#	crates/engine/src/script/dom.rs
#	crates/engine/src/script/mod.rs
#	crates/engine/tests/it/script_host_vs_scriptcheck.rs
#	crates/js/src/interp.rs
#	crates/ui-egui/src/script_runs.rs
#	docs/gaps.md
#	docs/mcp.md
#	docs/target-app-parity.md
2026-11-28 15:42:04 -08:00
.CooCoo e47136ed50 Merge pull request #9905 from dotCooCoo/fix/setliveshape-linked-art
Live Shapes: a new angle, radius or line takes a linked mask and placed gradients along
2026-11-28 08:02:39 -08:00
dotCooCoo 6cecde4358 Live Shapes: a pixel-aligned shape's pattern follows the snap after a carry
When object.setLiveShape carries a pixel-aligned shape with patterns on, the
final snap to the pixel grid now moves its patterns as well, so the pattern
keeps its place on the shape. With patterns off the pattern stays where it was.
2026-11-28 04:57:58 -08:00
dotCooCoo 33dc1f2d7b Bounds: a group's own stroke is measured along its members' shapes
A group's or layer's visual box grew by Appearance::outset(), the farthest
any of its strokes can reach from any path. For a miter-joined stroke that
is the miter limit times half the weight, so a 10 pt stroke of the group's
own round a square measured 50 pt past it instead of the 5 pt it paints.

The container's own strokes are now measured along each member path and
compound path, at any depth in its groups, as a path measures its own
strokes (Appearance::stroked_bounds). They add nothing round hidden members,
guides, images and symbol instances, which they do not paint, and grow the
box of other members (type, clip groups, live objects) by their reach as
before. visual_of_members keeps the old growth for callers that have only
boxes at hand.

The box of a group measured in a turned frame (Node::bounds_in) and
object.setBounds with Use Preview Bounds, which measures plain groups member
by member and symbol art object by object, measure a group's own strokes the
same way, so the size setBounds gives matches the visual box. There, too,
the strokes stop at hidden members and guides, and setBounds measures a
compound shape as one object, as its visual box takes it. A group's
own beveled or mitered stroke along a path with slanted segments now counts
as a slanted stroke corner (Node::has_slanted_stroke_corners), so setBounds
measures such a group as drawn when it sizes it out of proportion.
2026-11-28 03:56:47 -08:00
dotCooCoo 9e246c0598 Live Shapes: a new angle, radius or line takes a linked mask and placed gradients along
object.setLiveShape rewrote only the path after a new Rectangle, Ellipse
or Polygon Angle, Polygon Radius, Side Length, Make Sides Equal, Line
Length or Line Angle, so a linked opacity mask, placed gradients and
pattern tiles stayed where they were. The edit now applies the transform
between the old and new shape to the object, as object.scale and
object.rotate do, and then sets the new shape. Scale Strokes & Effects
and Transform Patterns come from the new `strokes` and `patterns` params
or the preferences. Corner radii in the mask keep their size, an object
named twice moves once, and the bounding box keeps its angle.

Transform Patterns is now noted in the journal when only the art of a
linked opacity mask uses a pattern, so a replay of object.move,
object.scale and the other transforms moves those tiles alike.
2026-11-28 03:16:59 -08:00
dotCooCoo 46ecbed2f3 Merge main into feat/scripts-api-d3-layers-artboards
# Conflicts:
#	crates/engine/src/script/dom.rs
#	crates/engine/src/script/mod.rs
#	crates/engine/tests/it/script_host_vs_scriptcheck.rs
#	docs/mcp.md
#	docs/target-app-parity.md
2026-11-27 22:09:03 -08:00
HassanKhan ea9cd206f6 Paste: a pasted clipping path is an ordinary path (#9227)
A copy of a clip group's clipping path kept its clipping mark when pasted
outside the group, so Offset Path and the other path commands skipped it
and Offset Path's OK did nothing. Paste now clears the mark, and Release
Clipping Mask clears it on a selected path that clips nothing, which
repairs paths pasted before this fix.
2026-11-27 13:24:20 +05:00
dotCooCoo b0241804b7 Merge main into feat/corners-link-popup 2026-11-26 06:37:26 -08:00
dotCooCoo 61d4b11d20 Merge main into feat/scripts-api-d3-layers-artboards 2026-11-25 22:13:49 -08:00
dotCooCoo 9c34c3a2fa Guides: a transform's reply lists the guide paths it makes of ruler guides
A selected ruler guide that a transform turns to an angle becomes a
selected guide path, but the reply's ids left it out: object.rotate
with copy on a lone guide returned {"ids": []}. transform_ruler_guides
now returns the ids of the paths it adds, and the transform commands
add them after the transformed objects, on the direct-selected anchor
route too.
2026-11-25 21:51:20 -08:00
dotCooCoo 281cee4379 Live Corners: the Corners pop-up applies its radius after the Stack
The pop-up's Radius edits are now collected inside the Stack and applied
after it, as the kind and rounding radios already are.

relativeRadii no longer turns a plain path into a Live Corners path here;
that change goes to its own pull request. relativeRadii on a plain path,
an ellipse or a line leaves it as it is and adds no undo step.
2026-11-25 18:21:19 -08:00
dotCooCoo c7ae974cf3 Merge main into feat/corners-link-popup 2026-11-25 15:35:14 -08:00
dotCooCoo 02b065e285 Merge main into feat/scripts-api-d3-layers-artboards 2026-11-25 14:48:25 -08:00
dotCooCoo 05b6a15d48 Guides: selected ruler guides rotate with the Rotate tool and Object › Transform › Rotate
A selected ruler guide was left out of every transform but a move: the
Rotate tool did nothing with only guides selected, and Object › Transform
› Rotate… refused with "nothing selected".

Each selected ruler guide now transforms as the line Release Guides makes
of it (across its artboard, or across the artboards' bounds for a canvas
guide), about the center of the selected objects' box and those lines
together. A guide that ends up vertical or horizontal stays a ruler guide:
a half turn keeps it and a quarter turn makes a horizontal guide vertical.
At any other angle it becomes a guide path along its line, on the guide's
layer, so it snaps, releases, locks and saves as other guide paths do.

- Object › Transform › Rotate… (Copy included), Transform Again and the
  Rotate tool's drag and Alt-click work with only guides selected, in one
  undo step. A turn that leaves the guides where they were records none.
- Scale, Reflect, Shear and the bounding box now transform selected guides
  along with the selected objects and direct-selected anchors, where
  before the guides stayed put.
- Locked and hidden guides, guides with ids given and guides with
  Transform Objects off do not transform. `absolute` with only guides
  selected is an error.

Part of #2418.
2026-11-25 10:37:15 -08:00
dotCooCoo 2b4e34c7a2 Merge main into feat/corners-link-popup 2026-11-24 20:39:43 -08:00
dotCooCoo ff2ceab181 Scripts: paths keep the paint they are drawn with as they enter or leave a compound path
- A path that node.move, move or duplicate puts into a compound path
  loses its own paint, live shape and pixel alignment, as Make Compound
  Path leaves its paths; the compound path becomes pixel-aligned when
  the path was. An empty compound path takes the paint the first path
  was drawn with: the path's own, or that of the compound path it
  leaves.
- A path that node.move or move takes out of a compound path into a
  layer or a group takes the compound path's paint and pixel alignment,
  as Release Compound Path gives them to its paths. Before, it kept the
  empty paint Make Compound Path left it and drew nothing.
- Artboard.name = '' gives the artboard its default name, Artboard N, as
  artboard.setProps gives a blank name, instead of throwing.
- The undo step of object.newGroup is named through `label`, so the
  translators' list reads Compound Path as well as Group.
- Tests: a compound path's pathItems list the topmost path first, and a
  path duplicated into a compound path keeps no paint, live shape or
  pixel alignment of its own.

Docs: docs/mcp.md (the order rule names the document's lists; move,
duplicate and node.move name a compound path as a place).
2026-11-23 19:07:47 -08:00
Jürg Lehni 53f5cf4228 Direct Selection: the arrow keys bend a selected curved segment
- Its anchors stay, and each handle keeps its direction and changes length by the step projected onto it
- The curve's middle moves one keyboard increment toward the arrow, less when the handles lie across it
- A retracted handle grows toward the other handle's end; a straight segment still moves whole
- A handle that flips through a smooth anchor leaves the next segment as it is
2026-11-23 23:41:33 +01:00