mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-05 21:42:59 -05:00
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.