Fix pen tool preview line disappearing during undo#4158
Open
Ankitt-02 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the pen tool's undo logic to reset point data when stepping back. The reviewer identified that the assignments to next_point and next_handle_start are redundant because they are immediately overwritten in the subsequent place_anchor call, and suggested only keeping the update to handle_end.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an issue where the Pen tool preview line could disappear after repeatedly undoing while drawing a path.
The undo flow restored anchor history state but did not fully restore the temporary preview/handle continuation state used by the active Pen tool session. This caused the preview segment from the last anchor point to the cursor to stop rendering consistently after multiple undo operations.
Changes
Updated the Pen tool undo handling to restore transient preview-related state during undo operations by refreshing:
next_pointnext_handle_starthandle_endThis keeps the preview segment active and consistent while continuing to draw after repeated undo actions.
Testing
Tested by:
Closes #3790