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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
- 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
- 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).
- 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