Fix the Pen tool's preview being misplaced and angle-locked after undo or redo#4215
Conversation
Keavon
commented
Jun 8, 2026
- Undo/redo: no longer leaves the locked angle snapped angle active while Ctrl and/or Shift are pressed
- Undo: no longer leaves the preview segment at a random place until the cursor is moved to update it
There was a problem hiding this comment.
Code Review
This pull request introduces suppression of the angle-lock (Ctrl) and angle-snap (Shift) modifier keys when they are held down during undo/redo operations in the Pen tool. It adds suppress_lock_angle and suppress_snap_angle states to PenToolData, along with helper methods read_modifiers and refresh_preview_after_history to handle the post-history state and defer preview re-rendering until after the graph has re-evaluated. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 3/5
- There is a concrete state-management risk in
editor/src/messages/tool/tool_messages/pen_tool.rs:refresh_preview_after_historycan leaveangle_lockedstale after undo/redo, which may cause incorrect angle-lock behavior when Ctrl is pressed again. - Given the issue is moderately severe (5/10) with solid confidence (7/10) and affects user-visible tool interaction, this carries some regression risk rather than being purely cosmetic.
- Scope appears limited to one file and one behavior path, so the change may still be manageable to merge once this reset path is verified.
- Pay close attention to
editor/src/messages/tool/tool_messages/pen_tool.rs- ensureangle_lockedis reinitialized correctly during history refresh and subsequent modifier-key flows.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic