The Type tool heard of Undo and Redo only when they ran as top-level
commands. As steps of command.batch, they left the caret where it was,
and the tool took the batch for an outside edit. Session::execute now
tells the active tool about each nested edit.undo and edit.redo.
command.batch also tells the tool when it begins, ends or rolls back.
The Type tool keeps its caret and its edit records at the start of each
batch and puts them back when a failed batch rolls the documents back.
While the Type tool edits type, Edit > Undo and Redo (the menu, the
keyboard, the History panel and MCP all run edit.undo and edit.redo)
left the caret at its byte offset, clamped to the text. Typing "abc"
before "XYZ" and pressing Undo left the caret after "XYZ".
The engine now tells the active tool about edit.undo and edit.redo
before it finishes the command. The Type tool keeps the edited text and
a list of the steps that changed it, and puts the caret, with nothing
selected, at the end of the span the step changed: where typed text
began after its Undo, after restored text after the Undo of a deletion,
and after retyped text after Redo. For the steps the tool made, it keeps
where the span ended, so text that repeats the characters next to it
puts the caret at the right end. A step that changes no characters,
such as a formatting change, leaves the caret and the selection as they
are. Typed lists keep their caret positions.
In Brazilian Portuguese the Character panel's Kerning field was named
Entrelinhamento, the word the catalog uses for Leading, so the two
fields had the same name. In Danish, Turkish, Indonesian and Dutch the
Reset Tracking and Kerning command named tracking with a different word
from the Tracking field, and in Dutch, Bulgarian and Greek the Info
panel's type line did the same.
The pt-br Kerning field is now Kerning (0 = Automático). The reset row
in da, tr, id and nl and the Info panel row in nl, bg and el now use
the word of the catalog's Tracking field. A new test checks that the
three fields have different names in every catalog and that the reset
row and the Info panel row use the field words.
An axial or radial shading's stops are the samples that linear
interpolation does not reproduce. An ink that changes nothing in RGB,
such as a varnish, could paint at dropped samples only, and its spot
swatch was then missing. Every sample now marks the inks it paints with
as used; the stops are unchanged.
A DeviceN color with a spot ink at a tint above 0 together with a process
plate or a second ink imports as RGB. The importer returned before marking
those inks as used, and only used inks become spot swatches, so the spot
ink was missing from the document and from every later export. Shading
stops take the same path, so a DeviceN gradient lost its ink the same way.
The art still imports as RGB with the existing warning; each ink it paints
with now becomes a spot swatch with its 100% color.
GIF, WebP and Targa files hold no resolution field, so document.formats and
the export docs now say that ppi, and the resolution that width or height
gives, are stored in the file except in those three formats.
PNG, PNG-8, JPEG, WebP, GIF, TIFF, BMP, Targa and PSD exports take
`width` or `height` in pixels. Each file is scaled so that its own
artboard, `rect` or art bounds is that wide or high, so with
`useArtboards` every file gets its own scale. `width` wins over
`height`, and either wins over `ppi` and `scale`, in the order an
Export for Screens row reads its size. The scale stays within 0.01 to
64 pixels per point and the file stores the resolution that results.
A value that is not a positive number is refused.
The per-file scale comes from `ScreenSize::scale_for`, which Export for
Screens rows already use. Rows keep their own size: their format
settings still drop `width` and `height`. `document.formats` lists the
two options for every raster format.
The check after the last file returned the cancelled error for every
export. A folder export without a ZIP has written each file by then, so
a cancel that came during a final step that writes nothing (a row whose
file repeats the one before it) reported a finished export as
cancelled. The check now runs only for exports that still hold their
files: those without a folder and those that make a ZIP.
A cancel that came after the last file's check was not seen: an export
without a folder returned its files or its archive anyway. The export now
checks once more after the last file and again after deflating the
archive, so a cancel returns the cancelled error and nothing is written
or returned.
zip::deflate takes a `stop` callback that it calls before each 1 MiB of
a file. Export for Screens passes the cancel state, so deflating stops
at the next MiB. file.package passes one that never stops, so its
behavior does not change.
With `zip: true`, document.exportForScreens deflated nothing: every file
went into the archive stored. Each file is now deflated, or stored when
deflating does not make it smaller, as file.package's archive does. The
file list, the names and the reply's fields stay the same; `bytes` and
the archive's contents change. Entries keep the fixed 1980-01-01 date, so
the same files still give the same archive.
The deflating writer moves from package.rs into fileio/zip.rs as
`zip::deflate`, beside `zip::store`, and file.package calls it there with
its own date and error text. The test reader `zip::entries` reads
deflated entries too. The `zip` option's text in docs/mcp.md,
docs/control-protocol.md and the command's params says the files are
deflated.
An Alt-click right of a short layer name, inside the wider rename
target, no longer replaces the selection. The isolated layer's own row
now selects the art inside it (layer.selectAll), where it cleared the
selection before. The doc line says the click selects visible, unlocked
art and clears the selection on a hidden or locked layer.
The reference app selects all objects on a layer with an Alt-click
(Option-click) on the layer's name in the Layers panel. In VectorCraft
an Alt-click on a name did what a plain click does: it highlighted the
row and made the layer current, and the art stayed unselected.
An Alt-click on the name of a layer or sublayer now also selects its
visible, unlocked art, as the row's selection square does
(layer.selectAll), and the layer still becomes current
(layer.setCurrent). On a locked or hidden layer the click clears the
selection, as that row's selection square does. On a group or object
row, beside the name, and with Shift or Ctrl/Cmd held as well, the
click does what it did before.
Docs: docs/mcp.md, docs/target-app-parity.md.
The reset ran paint.editGradient, which changes every run of a type
object and leaves a stroke without paint at weight 0. It now runs
paint.setFill or paint.setStroke with the linear White, Black gradient:
characters selected with the Type tool take it and the rest keep their
paint, and a stroke without paint gets the 1 pt weight, as a plain click
on the Gradient button already does.
The reference app resets a gradient to black and white when the
gradient button in the Tools panel is Cmd/Ctrl-clicked, and to the
default black and white linear gradient when the Gradient Fill box in
the Gradient panel is Cmd/Ctrl-clicked. In VectorCraft a Cmd/Ctrl-click
on either did what a plain click does, and the reset was only in the
Gradient panel menu.
A Cmd/Ctrl-click on the Gradient panel's thumbnail or on the Tools
panel's Gradient button now makes the gradient of the active Fill or
Stroke a linear gradient with the White, Black stops, through
paint.editGradient, as one undo step. A solid or no paint becomes that
gradient, and with nothing selected the default paint changes. A plain
click keeps its behavior, and the panel menu's Reset to White, Black
is unchanged.
Docs: docs/target-app-parity.md.
The reference app selects the complement of the current fill or stroke
on a Cmd/Ctrl-click of the Color panel's color bar and the inverse on a
Cmd/Ctrl+Shift-click, and with Alt (Option) also held it changes the
nonactive one. In VectorCraft these clicks picked the spectrum's color,
and a Cmd/Ctrl+Shift-click cycled the color modes.
A Cmd/Ctrl-click on the spectrum now applies Complement and a
Cmd/Ctrl+Shift-click applies Invert to the active Fill or Stroke, as
the panel menu's items do: a selected gradient stop or freeform point
is recolored in place, and a solid color goes through paint.complement
or paint.invert. With Alt also held, the click runs the command on the
inactive proxy, which stays behind. A Cmd/Ctrl drag still picks colors,
and plain, Alt and Shift clicks keep their behavior. The panel menu's
Invert and Complement use the same code.
Docs: docs/target-app-parity.md.
The released buttons go after the frame's last pointer movement, at its
position. Before, they went first, at the press position, so a press that
moved past the click distance in the same frame ended as a click on the
widget under the press.
egui ends a drag only on a button release or Escape. When the window
never receives the mouse-up, a drag such as a dock column's resize keeps
following the pointer with no button held.
On macOS, each frame's input now gets a release for every button egui
still holds when NSEvent.pressedMouseButtons reports no button down, at
the pointer's last position. Frames that carry a button event, and
control-channel input that holds a button between steps, are left as
they are.
A click with the Scissors tool cut the path whether or not Alt was
held, and the cursor stayed the Scissors cursor. The reference app's
shortcut list has "Switch Scissors tool to Add Anchor Point tool" on
Alt (Option).
While Alt is held, a click with the Scissors tool now does what a click
with the Add Anchor Point tool does: on a segment it adds an anchor
point with path.insertAnchor in one undo step, and the path is not cut.
The cursor is the Add Anchor Point tool's while Alt is held. When Alt
is let go, the cursor is the Scissors again and a click cuts.
Docs: docs/target-app-parity.md, crates/tools/src/cursors.toml.
The reference app's shortcut list switches between its Type tools with
Shift and with Alt (Option). VectorCraft's Type tools had no such switch.
While no type is being edited, a press with Shift held makes new type
with the chosen tool's horizontal or vertical counterpart: Type and
Vertical Type, Area Type and Vertical Area Type, Type on a Path and
Vertical Type on a Path. A press with Alt held makes it with Type on a
Path in place of Area Type, or the reverse, in the same writing
direction. With both keys held, both switch. The keys held when the
press starts are the ones that count. The pointer shows the tool the
press acts as, and the chosen tool stays selected. While type is being
edited, Shift and Alt work as they did.
Docs: docs/target-app-parity.md.
The reference app switches the units of measurement with
Ctrl+Alt+Shift+U on Windows and Option+Shift+Command+U on macOS.
VectorCraft could set the document's units with document.setUnits or
a right-click on a ruler, but no command stepped through them and no
key did it.
document.switchUnits (Switch Units, default Cmd+Alt+Shift+U) sets the
document's units to the next one in the order a right-click on a
ruler lists them: Points, Picas, Inches, Millimeters, Centimeters,
Pixels, Feet & Inches, Meters, Yards, Feet, and from Feet back to
Points. Each press is one undo step, and the reply names the new
units. Keyboard Shortcuts lists it under Document.
The precise cursors shortcut-editor test used Cmd+Alt+Shift+U as a
free key; it now uses Cmd+Alt+Shift+Q.
Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md.
With the Width tool, Escape did not deselect the selected width points:
they stayed selected, Delete still removed them, and in isolation mode
the same Escape left isolation mode. The reference app's shortcut list
gives Esc for deselecting a width point.
Escape now deselects the Width tool's selected width points. The path,
its widths and the undo history do not change, and no command is sent.
While width points are selected the tool takes Escape, so that Escape
does not also leave isolation mode. With no width point selected, and
during a drag, Escape does what it did before.
Docs: docs/mcp.md, docs/target-app-parity.md.
The reference app switches an arc between open and closed with C,
flips it with F and changes its angle with Up/Down while it is dragged
out. VectorCraft's Arc tool ignored these keys during a drag.
While an arc is dragged out, C now switches it between an open and a
closed path, F switches its base between the X and Y axes in the same
box, and Up/Down raise and lower its slope by 10 within -100 to 100.
Each press switches once. The arc drawn on release uses the new values,
and they stay as the Arc tool's options. With nothing dragged, C and F
are shortcuts as before.
Docs: docs/mcp.md, docs/target-app-parity.md.
A release that arrives at a new position with no drag before it now counts
as movement, so Alt pressed at that moment no longer switches the stroke
to the Smooth tool.
Alt switched a Blob Brush stroke to the Smooth tool while the stroke held fewer than two
points, so a drag that had moved less than the sampling tolerance still switched when Alt
went down. The tool now records whether the pointer has moved from the press point at all.
A release with Alt held, after a press without Alt and no movement, also smooths instead of
painting a dot, matching the Smooth cursor shown before it.
The reference app switches the Blob Brush to the Smooth tool while Alt
(Option) is held. In VectorCraft an Alt drag with the Blob Brush painted
a blob like any other drag.
With Alt held at the press, or pressed before the drag has moved, the
Blob Brush shows the Smooth tool's cursor and a thin line without the
length label, and the release smooths the selected paths under the
drag with path.smoothRegion, as the Pencil does when Alt key toggles to
Smooth Tool is on. Shift does not constrain a smoothing drag, a stroke
that has moved keeps painting when Alt goes down, and with nothing
selected the release changes no path.
Choosing another tool during a Pencil smoothing drag no longer leaves
the Pencil showing the Smooth tool's cursor when it is chosen again.
deactivate now clears the smoothing state, for the Blob Brush too.
Docs: docs/target-app-parity.md.
With "Alt key toggles to Smooth Tool" on, an Alt drag with the Pencil
smoothed within the Pencil's "Edit selected paths" Within distance. At
0, which turns editing off, it smoothed nothing. It now smooths within
the Smooth tool's 12 px radius at every Within value.
The search for the faces a merge unites compared each reported face's
coverage with every picked point's coverage. The picked points are now
grouped by coverage once, before the walk, and each face is tested only
against the points of its own coverage.
A merge found the contours of the faces it unites with one contour pass
over the whole arrangement for each coverage among them, and the search
for slivers next to them did the same for each neighboring coverage.
Each in-place remnant of a merge is such a merge too, so a click on
many overlapping shapes made one pass over the whole arrangement for
each coverage, for the merged faces and again for each remnant. Both
now use the batching that Divide's regions use: one pass for each batch
of coverages whose faces share no vertex. The batching looks a face's
coverage up by a hash of the inputs that cover it, computed as it walks
them. The search for slivers looks up the merged faces' coverages the
same way.
Merging a frame no longer takes in an island of the same coverage in
its hole: each face is its outer contour and the holes directly in it,
as the regions are.
A weight of 2.004 pt shows as 0.167 p in picas, the same text as the
2 pt preset. One click down on the spinner went to 2 pt and the field
did not change. The spinner now treats a preset shown with the same text
as the weight as reached, as the field's arrow keys do, so the click
goes on to 1 pt. A plain step also passes a whole-point step shown with
the same text as the weight: 2.0004 pt goes down to 1 pt.
A weight between the presets stepped to the next whole point, so 0.52 pt
went down to 0 pt. In the Stroke panel, the
Control bar and the Properties panel, a plain step of the spinner, the
arrow keys or the wheel now goes to the nearer of the next whole point
and the next preset in its direction: 0.52 pt goes down to 0.5 pt and
up to 0.75 pt, 0.4 pt goes down to 0.25 pt, and 1 pt goes down to
0.75 pt. From 1 pt up a step is still a whole point (14 pt to 15 pt),
and Shift and Ctrl/Cmd steps are unchanged.
In the field, a preset keeps its decimal places (0.0156 in), and a preset
the field shows with the same text as the value (2 pt as 0.167 p) counts
as reached, so the next press goes on to the next preset.
Deleting a point of a finished path with the Curvature tool sent
path.removeAnchor, which refits the two segments that met at the point so
one curve follows them. The path kept the bend of the deleted point
instead of curving through the points that remain.
The tool now sends path.removeAnchor with curvature: true, which uses the
new curvature_remove. Each smooth neighbor takes new handles from its new
neighbors, and an end beside one of them takes its end handle again. A
corner neighbor keeps its handle directions, and its handle on the new
segment scales with the segment's chord. With two points left, the points
that curve lose their handles. Object > Path > Remove Anchor Points and
the Delete Anchor Point tool still refit the curve.
the_canvas_hands_the_tool_cursor_to_the_os_and_idles_while_the_pointer_rests
asserts that the window asks for no repaint once the pointer rests. On a
loaded machine a canvas frame takes longer than 8 ms, so later frames go
to the render worker, and a worker frame that finishes during the idle
frames asks for a repaint (repaint delay 0, cause render_worker.rs:63).
The test now sets canvas.worker_started, as the canvas tests do, so every
frame renders on the test thread.
Called with `"ids": []` and nothing selected or targeted, the two commands
ran and put "select objects or give ids" in the status bar. An empty ids
list now counts as no ids, so the commands run nothing, as they do when
ids is left out. A non-empty ids list still adds to those objects.
The object row drew the None swatch when the selected objects' fills
differ, which reads as "no fill". It now draws the "?" chip the Control
bar and Properties panel use for differing paints.
An anchor added to a path that wasn't selected now selects that path,
the new anchor direct-selected, so the point shows and can be edited at
once instead of only after a Direct Selection click. Undo restores the
old selection; a path already selected (the Pen's Auto Add) keeps it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Offset Path outlined an open path on both sides, so a shape whose last
anchor sits on its first came out as a ring with a hole. Such a path is
now offset as a closed shape: its last anchor merges into its first,
which takes the last anchor's in-handle, with the same 1e-6 test that
Object › Path › Join uses for one path (crates/engine/src/cmd/path.rs).
The Offset Path effect calls the same function.
- Replace vec![Color32::TRANSPARENT; N] zero-initialization with direct single-copy bytemuck::cast_slice(&img.pixels).to_vec() in color_image.
- Eliminates redundant zero-filling of ~20.7 MB buffer on every canvas frame render on Retina displays, saving memory bandwidth and allocation overhead.
- Fallback preserves transparent image for undersized or mismatched pixel buffers.
Fixes#4504.
edit.colors.saturate's params text names intensity as required, but a
call without it, or with a string such as "40", read the intensity as
0 and still ran Saturate. It changed no visible color but recorded a
Saturate undo step.
edit.colors.saturate now reads intensity with f64_req, as shape.ellipse
reads its box. A missing, null or non-number intensity is the error
"missing number `intensity`", which changes nothing and records no undo
step. A number outside -100..100 still counts as its nearest end, and
the params text says so.
Saturate returns a color whose saturation stays the same, as at an
intensity of 0, as it was. The HSB round trip rewrote most such colors
in their last bit, so they counted as changed and lost their swatch
link.
In the same file, edit.colors.adjustBalance read a channel that is not
a number as 0, and color.harmony read steps or amount that is not a
number as its default. Both now refuse it with check_numbers, as the
commands docs/mcp.md lists for #1952 do. A null is still read as a key
left out.
Docs: docs/mcp.md, docs/target-app-parity.md.