Commit Graph
1571 Commits
Author SHA1 Message Date
dotCooCooandFredApps 777e0be488 Canvas: arrowhead bounds follow the painted head, and the pasteboard fade has no seams
The visual bounds of a stroke with arrowheads added a square around each
end point, as wide as the head's reach. With the arrowhead's align set to
"Tip on the end point", the head lies back along the path, so the
selection box reached past the tip by the head's whole length, leaving
empty room in front of the arrow. The bounds now take the box of each
head's outline from the same geometry the canvas paints, so the box ends
at the tip. The arrowhead geometry moves from vectorcraft-effects to
vectorcraft-doc so that the bounds code can use it; vectorcraft-effects
re-exports the same items.

The fade outside the artboards filled each of its pieces on its own, and
each faded out along the edges it shares with the next, so thin lighter
lines ran from the artboard's corners to the edges of the canvas. The
pieces are now filled as one unfeathered mesh (Draw::data_fill_tiled).

Fixes #10221
Fixes #10225

Co-authored-by: FredApps <[email protected]>
2026-12-05 13:46:17 -08:00
.CooCoo 48c7b50394 Merge pull request #10942 from dotCooCoo/fix/live-corners-anchor-add-delete
Live Corners: adding or removing an anchor keeps the corners live
2026-12-05 07:34:48 -08:00
.CooCoo e58d945341 Merge pull request #10638 from dotCooCoo/fix/retrace-keeps-note-and-tags
Image Trace: tracing again keeps the tracing's note and tags
2026-12-05 06:41:34 -08:00
dotCooCoo bdb87ce714 Live Corners: map removal successors in one pass over the subpaths
Remove Anchor Points mapped each subpath's next anchor to the path as
drawn with `LiveCorners::drawn_anchor`, which counted the anchors of
every earlier subpath again for each one. `LiveCorners::drawn_anchors`
maps the whole set while walking the subpaths once.

The docs now say that Remove Anchor Points selects the next anchor of
the uncut outline, which can be an anchor added on a side as well as a
corner.
2026-12-05 05:47:42 -08:00
dotCooCoo 0f52b4e6ad Merge main into fix/retrace-keeps-note-and-tags 2026-12-05 05:34:30 -08:00
dotCooCoo 81c7d60ea6 Live Corners: an added anchor keeps only the selected segments' ends selected
Adding an anchor on a side of a path with rounded Live Corners moved
each selected anchor to every anchor of its corner. The ends of a
selected segment are selected anchors, so a selected side also selected
the far ends of the arcs at its two corners, and an arrow-key nudge
then moved those anchors too. The ends of selected segments now follow
the segments instead: after the addition, only the ends of the
segments as drawn are selected. Anchors selected on their own still
select their whole corner.

A plain path no longer builds its corner layout for Add Anchor Point,
Delete Anchor Point or Remove Anchor Points before falling back to the
plain edit, and Add Anchor Point builds it once for the cut check and
the selection. The selected segments are matched to the new layout
through one lookup per subpath instead of a scan for each segment.

docs/mcp.md and the Live Corners entry in docs/target-app-parity.md
now say that removing anchors clears the path's selected anchors and
segments, and that Remove Anchor Points selects the anchor before the
removed one at an open path's end.
2026-12-05 05:20:08 -08:00
dotCooCoo a76b5a59ae Merge main into fix/swatches-name-index 2026-12-05 04:35:08 -08:00
dotCooCoo f26f8601e3 Merge main into fix/live-corners-anchor-add-delete 2026-12-05 04:31:47 -08:00
.CooCoo 9bdfcf7347 Merge pull request #10925 from dotCooCoo/fix/anchor-tools-type-on-path
Fix #10862: anchor tools and Pen + Alt edit the path of type on a path
2026-12-05 04:25:59 -08:00
dotCooCoo 116da84bc5 Live Corners: adding or removing an anchor keeps the corners live
Adding an anchor with the Pen or Add Anchor Point tool, or removing one
with the Pen, Delete Anchor Point, Remove Anchor Points or the Delete key
with Delete Removes Anchor Points and Keeps Paths Joined on, turned a
path with rounded Live Corners into a plain path: the arcs were baked
into anchors and the corner widgets disappeared.

path.insertAnchor now adds the anchor on the matching side of the uncut
outline, at the point the drawn segment has at t, and cuts the corners
again at their radii and kinds. path.removeAnchor and path.removeAnchors
remove the uncut corner each removed anchor belongs to, so removing
either end of a corner's arc removes that corner and the others stay
live; a path left with no corner is removed. A relative radius keeps the
length it is drawn at, up to the corner's new largest radius. Selected
anchors and segments follow their corners, a split selected segment
stays selected as its two halves with the new anchor, and Remove Anchor
Points selects the first anchor of the next corner.

An anchor added on a corner's arc still makes the path plain, and the
status bar now says the corners were expanded.

Docs: docs/mcp.md, the params text of path.insertAnchor,
path.removeAnchor and path.removeAnchors, and the Live Corners entry in
docs/target-app-parity.md.
2026-12-05 03:55:56 -08:00
dotCooCoo 402ff3024e Fix #10902: PDF spot images and image masks keep their fill overprint
PDF import read overprint for paths and text only, so an image in a
Separation space or an image mask drawn under /op true opened knocking
out, and a separations export of the document lost the ink beneath it.
The interpreter reports the graphics state's overprint before each
image; the importer now keeps the fill's on the image's colorize paint,
as the .ai reader does.

- Each draw of an image takes the state of that draw, so one XObject
  drawn twice can overprint once and knock out once.
- A process color overprinting in mode 0 gives the same warning as a
  path does.
- A page whose paths can't be counted drops the paths' overprint and
  keeps the images'.
- An isolated group holding an overprinting image stays isolated.
- Images read inside pattern cells, soft masks and type 3 glyphs knock
  out, as paths there do.
2026-12-04 23:48:23 -08:00
dotCooCoo eb320aefbb Fix #10862: anchor tools and Pen + Alt edit the path of type on a path
The Anchor Point tool, the Add and Delete Anchor Point tools, Pen + Alt
and the Pen's Auto Add/Delete only picked anchors of plain paths, and
the path.* anchor commands refused type on a path ("object #N is not a
path"), so dragging an anchor of type on a path's path did not pull
handles out, as it does on a path.

- The tools pick the anchors and segments of selected type on a path
  outside perspective, and draw its anchors and handles; Scissors still
  does not cut it.
- path.convertAnchor, path.reshapeSegment, path.setHandle,
  path.moveAnchor, path.insertAnchor and path.removeAnchor edit the
  type's path in document space through its transform; the type lays
  out again and its brackets keep their fractions of the path.
  path.removeAnchor refuses to leave it fewer than two anchors.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-12-04 23:43:12 -08:00
dotCooCoo 9386245a06 Merge main into fix/swatches-name-index 2026-12-04 20:37:39 -08:00
dotCooCoo 4a5f762c7d Merge main into fix/retrace-keeps-note-and-tags 2026-12-04 18:20:04 -08:00
dotCooCoo f74855acee Swatches: vectorcraft-doc turns swatch-scans on for its own tests
The gate's shard check failed on every shard: vectorcraft-doc's tests run
in the Rest shard, where no crate turned the swatch-scans feature on, so
they built with other features than under `cargo test --workspace`, where
vectorcraft-ui-egui's dev-dependency turns it on.

vectorcraft-doc now lists itself as a dev-dependency with swatch-scans on,
as vectorcraft-pdf and vectorcraft-eps do for their counters, so its tests
build with the same features in their shard and with the whole workspace.
2026-12-04 18:07:50 -08:00
.CooCoo 48488547af Merge pull request #10856 from dotCooCoo/fix/live-corners-keep-straightened-radius
Live Corners: a straightened corner rounds again when a later move bends it
2026-12-04 17:59:11 -08:00
dotCooCoo 887b93f0ef Merge main into fix/swatches-name-index 2026-12-04 17:56:11 -08:00
dotCooCoo ab636b1395 Image Trace: tracing again moves the tracing's attributes instead of copying them
Tracing a tracing again copied its attributes twice: once when the edit
read the tracing out of the document, and again for the new tracing. An
object can hold 64 tags of up to 64 KiB each, so each extra copy could
cost megabytes. The new tracing now takes the attributes from the edit's
own copy of the old one.

`vectorcraft_doc::attribute_copies()` counts copies of an object's
attributes on the current thread, and a test checks that tracing again
copies them once.
2026-12-04 17:20:38 -08:00
.CooCoo e24c62bf75 Merge pull request #10836 from dotCooCoo/fix/preview-new-id-lookups
Lookups: previews find an object added since the press without walking the tree
2026-12-04 14:20:07 -08:00
dotCooCoo de2a7a958b Live Corners: a pixel-grid snap converts relative radii as an anchor move does
With relative rounding, a move that bent a straightened corner converted
its stored radius to a fraction of the bent corner's maximum. When the
pixel-grid snap then straightened the corner again, the radius stayed in
those units, so the move changed the radius and recorded an undo step
although no anchor moved, and the corner rounded at the wrong size when
bent later. The snap of a path with Live Corners now converts the radii
of corners it straightens or bends, with the same rule as an anchor
edit, and a move the snap takes back counts as no change when the radii
differ only by rounding.

The help of object.setLiveShape, path.moveAnchor and path.moveAnchors
and docs/mcp.md now say that a straightened corner keeps its radius and
the path stays live.
2026-12-04 12:59:02 -08:00
dotCooCoo ab55c77d89 Live Corners: a straightened corner keeps its radius through a change of radius mode 2026-12-04 12:04:00 -08:00
dotCooCoo 1406dc8604 Live Corners: a straightened corner rounds again when a later move bends it
Moving the anchor of a path's only rounded corner into a straight line kept
its radius, but the next anchor move found no corner drawn with an arc and
edited the drawn path instead, dropping the live shape and its radius.
edit_corner_anchors now decides on the stored radii, so the corner rounds
again once a move bends it.
2026-12-04 11:29:52 -08:00
.CooCoo d742a49341 Merge pull request #10793 from dotCooCoo/fix/font-size-draft-target
Type: an unfinished Font Size value stays with the text it was typed for
2026-12-04 10:15:25 -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 4fa03c1e22 Tests: node finds an added object without copying its index path
copies_that_add_an_object_find_it_without_walking_again now also checks
that Document::node, in each of the 20 copies, reads the kept path for
the added object in place instead of copying it.
2026-12-04 06:25:52 -08:00
dotCooCoo 177d0c6700 Shapes: a whole star stays live whatever its pie angles hold
A whole star draws every point, so its pie angles no longer stop it
from being stored as a live star. Angles configured on any whole shape
are stored with it, so a later arc mode change uses them.

A corner list longer than the old corner count drops its entries past
the last corner before it is spread, so the corners a new point or
side count adds are sharp and keep the default kind.
2026-12-04 05:56:09 -08:00
dotCooCoo 8a136e25ce Lookups: previews find an object added since the press without walking the tree
Every preview of a drag starts again from the document as it was at the
press. Its lookup cache does not hold the object the drag adds (a Pencil
or Pen path, a shape), so each lookup of that object walked the whole
tree, about twice per preview, and the cache was rebuilt only in the
preview's own copy.

The cache now keeps, beside its table, the index path a walk found for an
id the table does not have. Every copy that shares the table reads it and
checks it against its own tree before using it, as it does the table's
paths, so later previews find the new object at that path. Repeated
nodes_in_order calls for such an id count toward a rebuild of the table,
and remove and move_node take the parent and the index from one lookup.
2026-12-04 02:35:23 -08:00
dotCooCoo 7e6cc1beba Swatches: the panel looks swatch names up in an index instead of scanning the list
The Swatches panel body runs on every repaint while the pointer is over
the panel or the Fill/Stroke chip popover is open. Each run looked names
up with Document::swatch and swatch_name_taken, which scan every swatch:
once per tint swatch, per selected name (selection check, Delete, Merge,
the group check), per thumbnail cell and per list row, and the thumbnail
highlight scanned the lit list once per cell. With 2,000 swatches all
selected, a hovered pass took about 140 ms in a release-profile build,
and about 100 ms with this change.

- The panel keeps a name-to-position map of the document's swatches and
  color groups (panels/swatches/index.rs). It is built again only when
  the document's swatch lists change, so edits of the art alone keep it,
  and it holds the lists' identity by weak reference. A name that several
  swatches hold finds the first, as Document::swatch does.
- The body, the thumbnails, the row icons, the footer and the panel
  menu's states look names up through it; the lit names are a set.
- The menu states, which also run while the panel is closed, build no
  index when nothing is selected.
- vectorcraft-doc gains a swatch-scans feature (dev-dependencies only)
  that counts the names Document::swatch and swatch_name_taken compare,
  for tests that count lookup work.
2026-12-04 02:14:35 -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 20a5b6eb50 Merge main into fix/doc-tests-unsafe-code 2026-12-03 19:53:53 -08:00
dotCooCoo bebaebdbe4 Type: an unfinished Font Size value stays with the text it was typed for
The Font Size field of the Control bar and the Contextual Task Bar kept a
value typed and not yet committed when other text with the same size was
selected, and the next Enter applied it there: 3+ typed for one text
object, then 1 and Enter with another selected, gave the second one 4 pt.

The field now passes an edit target to NumberField::edit_target: the
document, its File > Revert count, its Undo and Redo restore count (after
which a node id can name another object), and the text text.setStyle
changes (format_target): the range or story the Type tool has selected,
the whole edited text at a caret, else the selected stories. When it
changes, the field drops the unfinished value.

The range is clamped to the text, so Select All over characters that are
already selected keeps the value, and a range over the whole text counts
as a caret, which also changes the whole text. While Real-time Drawing off leaves
typing unapplied, the range is the Type tool's own offsets clamped to the
length the text has with that typing, so a range reaching into it is
another range than the applied text it starts in, and keeping the typing
keeps the value. In a threaded frame, where keeping the typing can reflow
text from the other frames, the offsets are not clamped.

SymbolPart derives Hash so the target can hold it.
2026-12-03 12:50:25 -08:00
dotCooCoo cb284a53c0 Shapes: saves for older versions write a live star as its path
A save for format versions 1 to 3 wrote `live: {shape: "star"}`, which
those versions' readers reject, so the file did not open there. These
saves now drop the live star and keep the outline it draws as a plain
path, in the layers, symbols, graph designs, patterns, opacity masks
and brush definitions. The current version keeps the star live.
2026-12-03 10:24:15 -08:00
dotCooCoo 9c11c47f75 Doc tests: unsafe code is denied in doc tests too
Rustdoc builds each doc test as its own crate, without the workspace's
`unsafe_code = "deny"` and without a library's `#![forbid(unsafe_code)]`,
so a doc test holding an `unsafe` block passed `cargo test --doc`.

- Every library root now carries `#![doc(test(attr(forbid(unsafe_code))))]`,
  or `deny` in cad, eps and metafile, which rely on the workspace lint.
- `cargo xtask layers` reports a library whose doc tests are missing the
  attribute, or use `deny` where the library forbids unsafe code.
- AGENTS.md names the rule next to the `unsafe` allowlist.
2026-12-03 09:51:28 -08:00
dotCooCoo c1efe27ff7 Merge main into fix/blend-round-corners 2026-12-03 09:09:26 -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
dotCooCoo de8cb948ea Live Corners: corners stay live after anchor moves
Moving an anchor of a path with rounded corners (Direct Selection drag,
arrow keys, path.moveAnchor, path.moveAnchors) threw away the live shape
and left the arcs as plain anchors, so the corner widgets disappeared.

The move now goes to the anchor of the uncut outline the drawn anchor
comes from, and the corners are cut again at their radii and kinds. A
live rectangle or polygon becomes a path with live corners. When the
recut changes the anchor layout, the selection is remapped through the
uncut outline and selected segments are cleared.

A path still becomes plain when it has no rounded corner, when a live
rectangle is sheared or scaled unevenly, when an arrow-key nudge bends or
holds curved segments, or for a transform other than a move.

Part of #10545.
2026-12-03 07:45:26 -08:00
.CooCoo 4f0d45d555 Merge pull request #10444 from dotCooCoo/fix/web-image-paste-speed
Paste: a bitmap copied in another app is not encoded and decoded again
2026-12-03 07:25:43 -08:00
.CooCoo 83f980389b Merge pull request #10200 from dotCooCoo/fix/empty-press-hit-once
Selection: a press that hits nothing checks only masked selected art for a way to click it
2026-12-03 07:20:03 -08:00
dotCooCoo 988a9b9193 Blend: test that unlike corner kinds keep the path route and steps keep the fill rule
Keys whose corner kinds differ blend anchor by anchor, and the last step
is the second key's outline. Steps between live rectangles keep the fill
rule of the key they are nearer and stay live rectangles.
2026-12-03 07:02:16 -08:00
dotCooCoo 3537d1bb60 Blend: live rectangle steps need keys with no scale left in their transforms
Live rectangle steps keep the first key's rotation and reflection. A
key whose transform still held a scale could pass the comparison with
a large scale on one axis hiding a difference on the other, and Align
to Path then folded that scale into each step, so its corners changed
shape along the spine. Only keys whose transforms are a rotation or a
reflection, the same for both, now take the live rectangle route; the
rest keep anchor matching.
2026-12-03 06:47:40 -08:00
dotCooCoo b4580f9fb9 Blend: steps between rounded rectangles keep round corners
Steps between two live rectangles were made by matching the keys'
anchors and moving each anchor and handle in a straight line. When the
keys' corners had different anchor layouts (a sharp rectangle and a
rounded one, or radii too large for one key), the steps' corners came
out as skewed curves, and every step lost its live rectangle.

Steps between two live rectangles with the same corner kinds and the
same rotation, reflection and shear are now live rectangles whose
width, height, position and corner radii lie between the keys'. Each
key's radii are the radii it draws, so a stored radius too large for
its rectangle counts as the largest that fits. A start anchor given for
either key, and every other pair, keep anchor matching.

Fixes #10707
2026-12-03 06:42:11 -08:00
dotCooCoo 47a8bcde18 Merge main into feat/scripts-api-d8b-tracing 2026-12-02 02:46:39 -08:00
.CooCoo 68b01f3a5d Merge pull request #10480 from dotCooCoo/fix/wrap-sources-no-copies
Text Wrap: Make's no-type warning checks the wrap objects without copying their shapes
2026-12-02 02:02:39 -08:00
dotCooCoo 4bcdc5d77c Merge main into feat/scripts-api-d8b-tracing 2026-12-02 01:26:36 -08:00
dotCooCoo beeeacafe5 Tests: text and doc tests check what the code returns, not only that it is there
Tests in vectorcraft-text and vectorcraft-doc that could pass on an empty
result, or that only checked a result exists, now assert the values:

- Blend: gradient steps assert their stop count before checking each
  stop's swatch, tint and plates; the odd dash blended to solid asserts
  the whole pattern; a copied step asserts its members.
- Symbols: limiting depth keeps every symbol; a stroke override on type
  keeps the run it styles.
- File fonts: an extreme descent clamps to the lowest table value and
  the Windows descent still fits.
- Invert wrap on a tangled shape asserts the line still meets it.
- Bidi, ligature carets, Thai and whitespace fallback: the glyph and
  line counts are asserted, Hebrew points stay in their letters'
  clusters, and every character of an isolate test has a glyph.
- Glyph categories, trace views, compound shape modes and digit
  systems check written-out ids instead of a round trip over every
  value.

Removed joins_on_a_circle_are_measured, which printed measurements and
asserted nothing, and chord_placement_leaves_the_join_gap_above_the_baseline,
which checked arithmetic done in the test itself;
joined_glyphs_meet_on_a_curved_path covers joined type on a curve.
2026-12-01 17:25:24 -08:00
dotCooCoo 6de89eece9 Merge main into feat/scripts-api-d8b-tracing 2026-12-01 09:00:59 -08:00
dotCooCoo c683302d4e Text Wrap: Make's no-type warning checks the wrap objects without copying their shapes
Make Text Wrap called wrap_sources to learn whether a new wrap object
sits above area type, which copied every wrap shape of every area text
object in the document into text space and threw the copies away.
wrap_source_objects gives the same text objects and wrap objects without
making those copies, and Make uses it.
2026-12-01 09:00:09 -08:00
dotCooCoo a992850228 Merge main into feat/color-randomly
# Conflicts:
#	crates/mcp/src/ui_catalog.rs
#	crates/ui-egui/src/menus/ui_commands.rs
2026-12-01 06:26:48 -08:00