Skip to content

Fix the Pen tool's preview being misplaced and angle-locked after undo or redo#4215

Merged
Keavon merged 2 commits into
masterfrom
fix/pen-undo-redo-preview
Jun 8, 2026
Merged

Fix the Pen tool's preview being misplaced and angle-locked after undo or redo#4215
Keavon merged 2 commits into
masterfrom
fix/pen-undo-redo-preview

Conversation

@Keavon

@Keavon Keavon commented Jun 8, 2026

Copy link
Copy Markdown
Member
  • 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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_history can leave angle_locked stale 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 - ensure angle_locked is reinitialized correctly during history refresh and subsequent modifier-key flows.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread editor/src/messages/tool/tool_messages/pen_tool.rs
@Keavon Keavon merged commit 04bca4a into master Jun 8, 2026
10 checks passed
@Keavon Keavon deleted the fix/pen-undo-redo-preview branch June 8, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant