Defer click selection when starting area-select rectangle drag#3542
Open
nklbdev wants to merge 1 commit into
Open
Defer click selection when starting area-select rectangle drag#3542nklbdev wants to merge 1 commit into
nklbdev wants to merge 1 commit into
Conversation
27d145d to
b4c667a
Compare
✅ Deploy Preview for blockbench-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
50533a7 to
23b01fc
Compare
23b01fc to
d7ea93b
Compare
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.
Problem: When starting an area-select rectangle drag from the surface of a mesh element,
mousedownimmediately triggers a click that selects the element — before the drag even begins. This is especially disruptive when using Shift to extend selection: the unwanted element gets selected on mouse-down, and the rectangle then operates on a polluted selection state.Fix: When the
preview_area_selectkeybind triggers, normal click processing is skipped entirely. Control goes directly tostartSelRect(). If the mouse is released without significant movement, the saved event is replayed as a deferred click viastopSelRect()— so single clicks still work as expected. Areplaying_clickflag onthis.selectionprevents the guard from intercepting the replay and blocksstartSelRectfrom being called again from within the replayed click handler.Flow:
mousedown(area-select)deferred_event, callstartSelRectmousemovewith rectangle activationviewportRectangleOverlapmouseup(was drag)Undo.finishSelection('Area select')mouseup(no drag)replaying_click = true→click(deferred_event)→ normal click processing