A restored selection loads its paints for new art only when the journal
records it with a selection command that loads them on replay. An
Objects on Path member, recorded as object.objectsOnPath.selectMember,
now keeps the paints as they are, as a symbol part already does.
Restoring a selection now clears the marker a defaults-only paint left,
as every top-level command does, so new art takes the restored
selection's appearance live as it does when the journaled select.set
replays. A restored symbol part no longer loads its paints for new art,
as symbol.instance.selectPart, the step the journal records for it,
does not.
When a failed DWG Replace gives the user's selection back in the active
document, the journal now records that selection (through the same steps
an interaction uses, in open undo groups too), so a recorded action
replays later commands on the restored objects. The paints for new art
load from the restored selection as they do after select.set, so the
next shape does not take the swapped object's paints.
With an add-on dialog previewing (Arrange in Grid, for example),
File > Place ran inside the preview's interaction, because every
`file.*` command other than `file.documentColorMode` was treated as one
that reads the drawing on show. The placed art went into the preview
document with no undo step of its own, and Cancel removed it.
`file.place` now runs on the document without the preview, as other
edits do: it records its own undo step and stays after Cancel and OK.
Save, Export, Copy and the other `file.*` commands still act on the
drawing as the preview shows it.
Docs: docs/mcp.md (undo/redo row).
Since #10882 a canceled undo group, and a canceled undo scope that put
back an earlier snapshot, advance history_restores, which every edit
target that reads rollbacks also hashes. They no longer advance
rollbacks as well, and the two engine tests for that are removed;
history_mem.rs covers the count.
The Corner Radius tests now cancel an interaction whose preview drew
the shape, which only rollbacks counts, so they still fail without
rollbacks in corner_target.
When the Type tool leaves an empty text object, Discard Empty Type
takes back the step that made it, which also frees the text's node ID.
It did not advance the document's rollback count, so a value typed in
a panel field for the text and not yet committed (Opacity, for example)
stayed in the field, and the next Enter applied it to a new object that
took the same ID. Discard Empty Type now advances the count.
A command that panics puts back every document it changed. That restore
now advances the rollback count of each document whose snapshot it puts
back, for the same reason.
Tests: an engine test for each restore, and a Transparency panel test
that types 20+ in Opacity for an empty text, discards it, selects a new
rectangle with the same ID and types 1 and Enter.
New art and type took the graphic style picked with nothing selected by
its name, so in another document they were linked to a style of the same
name there, and took its isolate and knockout. The template now records
the document the style came from, and new art elsewhere takes the look
without the link.
New area type that text wrap moves as it is made (an Auto Size frame
below a wrap object grows) had the template's placed gradients fitted to
the frame before the reflow. Both ways of making type now let text wrap
reflow it first and fit the gradients to the frame it ends with; type
whose bounds do not change keeps its placement.
The docs name text.create as the command whose type takes the template,
state that Type on a Path and Area Type keep the default appearance, and
note that a color given to text.create keeps the characters' fill under
Override Character Color.
The user's selection came back only while the document revision was
unchanged, so a Replace whose rollback raised the revision, or any edit
that left the selection alone, kept the swapped object selected.
DocState now counts selection changes (`selections`): every
Session::select, Undo and Redo, leaving isolation, and any command or
batch step that leaves another selection. A failed command that selected
its ids first puts the count back with the selection. The selection
comes back when the count, the selection, the isolation and the user's
objects are unchanged; a symbol part needs the art unchanged.
The live shape fields in the Transform and Properties panels and the
Contextual Task Bar (a rectangle's, polygon's or ellipse's Angle, a
polygon's Sides, Radius and Side Length, a star's Points and Ratio, an
ellipse's Pie Start and End Angle, and a line's Line Length and Line
Angle) kept a typed but unfinished value when another shape was
selected. If the new shape showed the same value, the field went on
showing the old text, and the next Enter applied it to the new shape:
"3+" typed for one rectangle, then "7" and Enter after selecting
another, turned the second one 10 degrees.
Each field now passes NumberField::edit_target the active document, its
File > Revert count, its Undo and Redo restore count, its rollback count
and the selected objects, which object.setLiveShape changes. A change of
any of them drops the unfinished value and the field shows the new
shape's value. An edit that leaves the selection as it is keeps the
value typed so far. The target is hashed once per document revision and
kept in CanvasCache::shape_edit_target, as the shared angle beside it
is.
DocState::rollbacks counts the other ways an older document snapshot
and its node ID counter come back, after which a new shape can take the
node ID of the shape a value was typed for:
- a canceled undo group, or a canceled undo scope that changed the
document;
- canceling an interaction whose preview changed the document;
- Exit Symbol Editing Mode with nothing changed, which takes back the
entering step;
- a plug-in run made away from the session that ends without applying
after its calls changed the document;
- a preview that discards an earlier preview that allocated node IDs,
or that fails after discarding an earlier preview's change. The
count goes to the document whose preview was discarded, also when
the preview activates another document;
- a command run during a tool interaction that sets aside a preview
that allocated node IDs.
history_restores still advances only on Undo and Redo.
A value typed into the Stroke panel's Weight, Miter limit, dash, gap,
Dash offset or arrowhead Scale field without Enter stayed in the field
after another object with the same value was selected, and Enter then
applied it to the new selection: "3+" typed for one line and finished as
"1" on another set that line to 4 pt. The Appearance panel's weight
fields and the Control bar and Properties weight fields did the same.
The fields now take an edit target: the document, its File > Revert
count, the revision of the document the next edit builds on, the
new-art paint, the selection and its subjects, the active Appearance
row, the symbol part, the Live Paint Bucket, the Type tool's characters
or story, and the Global Edit members. When it changes, the field drops
the unfinished value and keeps its focus. While the stroke editor's or
the arrowhead Scale fields' own scrub or step runs, they keep the target
they started with, and an outside change to the document ends the
gesture.
A command that replaces a tool drag's starting document, or changes the
perspective grid during a drag, now advances the drag's baseline
revision, so the target changes with it.
craft-libs is pinned to the commit that adds StrokeEditor::edit_target
and LinkedFields::edit_target.
During an add-on dialog's preview, a command from outside the dialog no
longer acts on a path whose selected anchors the preview renumbered (Set
Corners recut it), so Clear does not delete other points of the base
path. A refused outside command leaves the dialog's own selection as it
was, while a command that ran, such as Deselect, still sets it. The
journal records the selection the command acts on before it, so an
action replays it on the same objects.
A canceled undo group, or a canceled undo scope that put back an earlier
snapshot, now advances the document's history restore count, as Undo
and Redo do. The same steps can make an equal object with the same id
again after such a cancel, so Raster Settings, Placement Options and
Create Object Mosaic ask to be reopened. A scope canceled without an
edit puts back the same snapshot and does not count.
Raster Settings OK also refuses while a tool edit computed on another
thread is pending, since running the command would apply that edit
first, after the targets were checked.
When the objects the dialog opened on render again, OK clears their
earlier fallback warning from the status bar while it still shows it,
unless a selected object still gives that warning; the selection's
first other warning takes its place.
During an add-on dialog's preview, a command from outside the dialog
now uses the selection on show, without the objects the preview made,
instead of the selection from before the preview, so Clear no longer
deletes art that was not shown selected. A failed preview runs again
when an outside command changes only the selection, and the new-art
paints a selection command loads stay with the selection it made.
With Add Artboard Guides previewing, deleting an artboard from the
Artboards panel ran inside the preview's interaction. On the next frame
the dialog could no longer find its artboard, canceled the preview, and
the cancel put the deleted artboard back. The same happened in every
add-on dialog: any command run while its preview showed was undone by
the next preview or by Cancel.
An add-on dialog's preview now marks its interaction (`dialog`). A
command from outside the dialog sets that interaction aside, runs on
the document without the preview as an undo step of its own, and the
dialog previews again from the command's result and selection, as a
tool drag already does. `edit.copy` and the `file.*` commands other
than `file.documentColorMode` still act on the document as the preview
shows it, and Edit Points Only keeps the old behavior, since it
previews a selection. A preview whose snapshot an outside command
changed runs again, also after a failed run.
Docs: docs/mcp.md (undo/redo row).
Conflicts resolved by keeping both sides: the session state and script
and batch rollbacks keep the Concept to Vector jobs beside main's retype
hand-off, clipboard counts and plug-in events; the plug-in deny list
keeps main's entries in order. The Control bar and Properties' Quick
Actions take main's framework buttons with Concept to Vector added
after Crop Image, and the task bar test uses main's helpers. In
docs/ui-parity.md the Concept to Vector row moves into main's table
with its Headless column.
When a DWG Replace fails or is canceled, the user's whole selection now
goes back through the selection filters as they are at that moment:
ruler guides locked since are left out, hidden or locked slices stay
out, and new art on a locked artboard is selected again as new art.
Before, only the object ids went through the filters and the guides and
slices were copied back, while new art on a locked artboard was dropped.
Session::restore_selection gives a document back a saved selection
through those filters. The dxf_import test that covers a selection made
after OK now selects a different object instead of the Replace target.
Placing a DWG drawing with Replace selects the object it swaps again at
OK. When the drawing was then not placed (an error while it was read,
or Cancel), that object stayed selected and the selection the user made
since Place started was lost.
- The user's selection comes back with select.set, with its anchors and
symbol part, when the read fails or is canceled, unless the document
changed since OK (a selection made since then is kept).
- Cancel restores the selection of the document the drawing was placed
in without switching documents, and not after File > Revert.
- The current layer stays current.
The canvas hands every pointer move of a frame to the freehand tools, and
each move ran a full preview: the stroke was fitted again, inserted into
the document and run through every post-edit pass, and the next move's
preview threw it away. A pen or a fast mouse delivers several moves per
frame, so drawing slowed down with both the move rate and the document
size (#4343).
- SessionTool keeps the drag samples of a pass and hands them, with the
release when it comes in the same pass, to the new
Session::pointer_samples. Every other tool call hands them over first,
so the order of events does not change.
- Session::pointer_samples feeds every sample to the tool and applies
only the last preview of each run of previews of one command. The held
preview is applied before the release and before any other action.
- Every preview still runs during a Global Edit, with Objects on Path
selected, with more than one object selected, and with New Art Has
Basic Appearance off when the stroke began with a selection, since a
preview there changes what the next sample reads. The decision is
made again after each event that is not a drag.
PlacedItem.file and PlacedItem.relink() ran file.place.info on the file
to check that it held an image, then file.place or links.relink read and
decoded it again. The image check now runs inside file.place and
links.relink while a script places or relinks an image: a file in no
image format is refused before the document changes, with "The file is
not an image", and a damaged image keeps its own error. The double read
came in with fed96731e2 (#9077).
A test counts the engine's file reads and fails with 2 reads on main.