VectorCraft's UI moves onto the shared craft UI framework in storytold/craft-libs (`next`; the framework side is storytold/craft-libs#2809), as PhotoCraft's did. The app keeps its engine, document model, file formats, commands and automation; its windows, panels, bars, dialogs and canvas are now built and driven by the framework: shell, docking and panels, hosted dialogs, keyboard, focus, IME and pointer routing, and theme tokens.
About 264,000 lines of VectorCraft's own egui UI code are removed and about 154,000 added. craft-libs is pinned at bf62d509f (in `next`), the egui fork at f5025284.
Tests that drove the old UI were rewritten against the port where only their premise changed, with their assertions kept. The UI tests still failing at merge, and their follow-ups, are listed in the pull request.
A press on a length handle kept the Smart Guides of the hover before
it, so a guide or label at the handle stayed on screen for the whole
drag. The press now clears them, as a press away from a handle does
when it places a point.
A length drag that changed the length and then came back to where it
started previewed the path again at its first length, so letting go
recorded an undo step for an unchanged path. A drag that ends at the
length the piece started with is now taken back as Escape takes it
back, on the path being drawn and on a selected path.
A Cmd press with the Selection tool now selects behind on a group that
holds a selected member, as it does on a selected object, so repeated
Cmd-clicks on grouped art reach the object behind the group. A path's
segments no longer keep the press for Direct Selection, so a Cmd-click
on a selected stroke-only path selects behind it. Select Behind needs
another object under the pointer: on a lone object the press is lent.
The bounding box's handles and rotate zones also lend the press.
- A double-click that follows a Cmd-click selecting behind keeps what
that click selected, without isolating or editing, also when the
press and the double-click come in one frame. After an edit or a
selection change, or after a press that drags or is released away
from where it began, it is an ordinary double-click.
- Whether a press selects behind is kept for the pointer's position
while the document, the selection, the live inputs and the hit-test
settings stay as they are, so the cursor, the canvas marks and the
press do not walk the document again. A layer or group effect that
draws art widens the area checked; raster effects and color
adjustments do not.
- The selected blends' spines are built once per check.
- The status bar and the help bar name the tool a press at the pointer
takes, which is the Selection tool where the press selects behind,
and they are drawn again when it changes. The canvas drops a hover's
decision once the tool, the selection or a preference it depends on
changes.
Docs: docs/mcp.md (pointer_gesture, and Cmd+Alt with Direct
Selection), docs/control-protocol.md, docs/ui-parity.md,
docs/target-app-parity.md.
A press keeps the pointer and the snapped point for the end of the piece it adds. When Alt
changes the action during the press, the end goes through the protractor's tick again for the
new action, so a continuous arc that snapped to a tick and becomes a sharp-corner arc ends at the
pointer, and a piece that becomes a continuous arc goes onto the tick, without waiting for the
next drag. This also covers a press that has not dragged.
A press keeps the pointer and the snapped point for the end of the piece it adds. When Alt
changes the action during the press, the end goes through the protractor's tick again for the
new action, so a continuous arc that snapped to a tick and becomes a sharp-corner arc ends at the
pointer, and a piece that becomes a continuous arc goes onto the tick, without waiting for the
next drag. This also covers a press that has not dragged.
A continuous arc that starts a path has no direction to follow and
sweeps the arc size, as a sharp-corner arc does. Moving its end onto a
protractor tick put the end on a circle the drawn arc does not follow,
so `tick_end` now gives no tick for it.
The hover keeps the snap settings it was made with (`SnapSettings` in
guides/snap.rs: the window, zoom, snapping options, tolerances,
Alignment Guides and construction angles). After one of them changes
under a still pointer, the hover's rubber band, protractor, distance
label and Smart Guides are hidden until the pointer moves, also through
a press, so the preview shows no point that a click would not place.
A press also drops the hover, so after a click puts an arc's end on a
tick no preview runs from that end back to the pointer. While the
pointer hovers, the tool asks the canvas to hover it again when the
view, the document or the selection changes (`wants_rehover`).
A continuous arc that starts a path has no direction to follow and
sweeps the arc size, as a sharp-corner arc does. Moving its end onto a
protractor tick put the end on a circle the drawn arc does not follow,
so `tick_end` now gives no tick for it.
The hover keeps the snap settings it was made with (`SnapSettings` in
guides/snap.rs: the window, zoom, snapping options, tolerances,
Alignment Guides and construction angles). After one of them changes
under a still pointer, the hover's rubber band, protractor, distance
label and Smart Guides are hidden until the pointer moves, also through
a press, so the preview shows no point that a click would not place.
A press also drops the hover, so after a click puts an arc's end on a
tick no preview runs from that end back to the pointer. While the
pointer hovers, the tool asks the canvas to hover it again when the
view, the document or the selection changes (`wants_rehover`).
With the Selection tool chosen, holding Cmd (Ctrl on Windows and Linux)
now lends Direct Selection, or Group Selection when that was chosen
last, for each press; the Selection tool is back on the release. With
Group Selection chosen, Cmd lends the Selection tool, as it already did
with Direct Selection. Selection & Anchor Display > Command Click to
Select Objects Behind keeps a Cmd press on a selected object, away from
its anchors, handles, mesh points and spine, for selecting the object
behind it. A wide stroke's painted area counts as on the object there.
- The double-click or triple-click after Cmd-clicks goes to the tool
the clicks went to.
- Cmd pressed once a drag is under way lends nothing, and the pointer
stays the active tool's.
- While Cmd is held, the status bar's Current Tool and the help bar
name the lent tool, and the canvas shows the lent tool's marks and
widgets (blend, Shaper, mirror, trace divider and repeat handles) for
the pointer's position in the same frame.
- The help bar has hints for Group Selection.
The helper that finds a selected object's editable parts under the
pointer follows the one in pull request 6597 by SofiaAFigueredo.
Docs: docs/ui-parity.md, docs/control-protocol.md (ui.pointer).
Co-authored-by: SofiaAFigueredo <223278896+SofiaAFigueredo@users.noreply.github.com>
Wherever the Quick Pen tool shows an arc's protractor (while the arc is
dragged, or as the piece the next click adds), it also draws a small cross at
the arc's center, as the circle and three-point arc tools draw theirs. The
cross is VectorCraft's own behavior.
Adds a test for the cross while hovering and dragging.
While an arc is drawn, by a drag or as the piece the next click adds, the
Quick Pen tool shows a protractor around the arc's center: a tick every 15°
from where the arc starts, a longer one every 90°, and one where it ends. The
piece the next click adds shows its protractor only while Enable Rubber Band
for the Pen tool shows that piece.
With Smart Guides on, the end of a continuous arc snaps onto the nearest tick
of its protractor, on the same circle, when the tick lies within the snapping
tolerance of the pointer, no other Smart Guide snaps the point, and neither
Snap to Grid nor Snap to Pixel snaps drawn points. A sharp-corner arc sweeps
its arc size, so its end does not snap. Shift does not constrain Quick Pen
points, so it does not change the snapping. The protractor, its 15° step and
the snapping are VectorCraft's own behavior.
The Smart Guides targets now also report whether a point landed on one of
them (`Targets::snap_hit`), so a target whose label or line is hidden still
takes precedence over a tick.
Adds tests for the arc's circle, the tick snapping by drag and by click and
its precedence, and the protractor during a drag and while hovering. Also adds
tests of existing Quick Pen behavior: a point snapping to a Smart Guide, and
the distance label shown while hovering.
The nine graph tools showed the same column chart, the eight symbolism tools
the same spray can, and Perspective Selection, Slice Selection, Enclosing
Lasso, Polygonal Lasso, the Corner Tool, Slide Anchor Along Path and Shared
Edge Merge each reused the icon of another tool. The 3D Box Tool asked for an
icon that does not exist and showed the dashed placeholder.
Each of these tools now has an original icon drawn in the dc-* style (24x24,
1.5 stroke, round caps) that shows what the tool does:
- Each graph tool draws its own chart type.
- The symbolism tools show symbols being moved, pulled together, resized,
turned, tinted, faded or styled.
- The Lasso and Slice tools get dc-* icons too, so the three lasso tools and
the two slice tools each read as one family. The Enclosing Lasso adds a filled square inside the Lasso's loop,
and the Polygonal Lasso draws the loop with straight sides and keeps the
same knot and tail. The Slice and Slice Selection tools both show a dashed
slice outline with a corner tag, the Slice Tool with a knife beside it and
Slice Selection with a pointer.
- Perspective Selection shows a smaller perspective grid with a pointer.
- The 3D Box Tool uses the cube icon that the 3D and Materials panel uses.
Each new file has an ASSETS.md row.
every_tool_has_an_icon_no_other_tool_uses checks that every cataloged tool,
the add-ons' included, maps to an existing icon that is not the placeholder
and that no other tool uses.
A dimension of a whole path whose line lay across the path, made vertical
or horizontal with dimension.update, now goes as far past the path as it
lay from its first point. Before, its line landed on the path's edge. A
line on the edge to within rounding still counts as outside the path.
When the new place would be more than 1,000,000 pt from the first point,
the update is an error unless it also gives offset, and the dimension is
left as it was. A dimension whose measured node is missing or is not a
path, as in a file that names a node it does not hold, is unlinked at the
next edit.
Tests: a dimension of a whole path saved in a native file and opened
again still follows the path, and one that names a missing node is
unlinked at the next edit; past a corner of the path the side the
pointer is farther out on decides; after the first point Alt picks a
point; a hovered segment's length stays by the pointer at a high zoom.
The line in docs/target-app-parity.md now attributes only the Alt hover
over a path to the linear dimensions help page. Docs: docs/dimensions.md
and dimension.update's params text.
Smooth Tool Options gets a Smoothness setting under Fidelity, from 0% to
100%, where a higher value leaves a smoother path, as the help page
describes the setting:
https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=164
- path.smoothRegion takes an optional `smoothness` (0 to 100, 50 when
left out). It scales the spread of the averaging done before the
refit in proportion: none at 0, today's spread at 50, twice it at
100. A value outside 0 to 100 is an error and changes nothing.
- The Smooth tool keeps the option with its preferences and sends it
with each drag; Alt smoothing with the Pencil, Paintbrush and Blob
Brush uses it, as it already uses the Smooth tool's Fidelity.
tool.setOption refuses a value outside 0 to 100.
- The default and the way the percentage scales the smoothing are
VectorCraft's own; the default keeps today's strength.
Docs: docs/mcp.md, docs/target-app-parity.md.
A saved preferences file is restored onto the drawing tools without the
option check that tool.setOption applies. A Spiral segment count or a
grid divider count that was not a whole number (a string, a fraction, a
negative, null) reset the tool to 10 or 5 instead of keeping its
current count. The Arc tool's base axis took any string other than y as
x. Each now keeps its current value for such a value, and a whole
number keeps its existing range.
While a shape is dragged out, an ignored count or axis no longer
replaces the drag's starting value, so Escape puts back the values the
drag started with.
The band a smoothing drag shows took the Smooth radius in points without
the 1,000 pt bound the release applies, so below 1.2% zoom it drew wider
than the region path.smoothRegion smooths. It now uses the same bound.
A press on one part of a dimension now also checks its other parts for
a geometry effect, so an effect on an extension line keeps the drag
from moving the dimension (and from drawing the parts again without
the effect). In isolation mode, only art inside the isolated object is
compared with the dimension when the press decides between them.
With the Linear Dimension tool and Alt (Option on macOS) held, hovering a
path shows a box through its outermost points (a Smart Guide when Smart
Guides are on), with its width and height beside the pointer when
Measurement Labels are on. A click on the path, then a placing click, or a
drag out from it, places a dimension of the whole path. With the pointer
above or below the path it measures the width, between the leftmost and
rightmost points; beside the path it measures the height, between the
topmost and bottommost points. The linear dimensions help page describes
the Alt hover; which side gives which measure is VectorCraft's own rule.
dimension.create takes a new source, {kind: extent, node}, for linear
dimensions. Its points are the outermost points of the segments the path
draws, curves included, and are read again whenever the path changes, so a
turned path shows its new overall width or height. The line keeps its
distance from the whole path when the path changes or is reflected, and
when dimension.update changes the orientation, which now reads the other
pair of points. When the box through the path's outermost points stays
where it was, as after Reverse Path Direction, the line stays on its side.
A version without the extent source does not open a file that holds one.
The measurement label beside the pointer while two points are picked now
keeps its distance in screen pixels at any zoom.
The Help Bar hint names Alt+Click. Docs: docs/dimensions.md and
docs/target-app-parity.md.
path.smoothRegion read a radius below 0 as 0 and moved a fidelity into its
range, and path.joinScrub read a tolerance below 0 as 0. Each now refuses
a value outside its range with an error naming the key, and the document,
the selection and the undo history do not change: radius and tolerance
0.001 to 1000 pt (the Path Eraser's width range), fidelity 0.000078125 to
about 3195 pt (the Smooth tool's 0.05 to 100 px at the highest and the
lowest zoom). A key left out or null keeps its default.
The Smooth, Join and Path Eraser tools, and an Alt smoothing drag with the
Pencil, Paintbrush or Blob Brush, keep what they send within these ranges
at any zoom, also when the interface zoom puts the tool's zoom past the
view's range.
Docs: params text, docs/mcp.md, docs/target-app-parity.md.
The tool passed over the circles it drew until the undo history moved, the
tool changed or another document became active. Deselect and a pick in the
Layers panel change only the selection, so the drawn circles stayed out of
reach. The tool now forgets them once the selection holds none of them,
after a command run from outside the tool and at the next pointer event.
docs/mcp.md and the tool's module comment name every case that makes the
circles reachable again. The engine's Undo test checks which path the click
hit, and a comment on the set in candidate_paths says the loop skips ids
that are already listed.
The span a parallel line is checked across now runs from the lowest to
the highest point of both lines along the dimension. It no longer
depends on which end of the other line comes first, and it has no
one-point floor, so a short line that stays within 0.000001 pt of its
level is a level.