fix: snap immediately#7745
Merged
BeksOmega merged 1 commit intoRaspberryPiFoundation:v11-breaksfrom Jan 9, 2024
Merged
Conversation
cpcallen
reviewed
Jan 5, 2024
Collaborator
cpcallen
left a comment
There was a problem hiding this comment.
Looks like I should ultimately only need to review the second of the two commits in this PR, correct?
Comment on lines
-461
to
-463
| if (this.workspace.isDragging()) { | ||
| return; // Don't bump blocks during a drag. | ||
| } |
Collaborator
There was a problem hiding this comment.
Is it safe to remove this check?
Contributor
Author
There was a problem hiding this comment.
Yeah there's no reason this should be called while the workspace is dragging. It only gets called when we click a block in the flyout to create it, or when we finish dragging a block.
c9610ca to
c80bf82
Compare
cpcallen
approved these changes
Jan 9, 2024
BeksOmega
added a commit
that referenced
this pull request
Jan 23, 2024
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.
The basics
The details
Resolves
Work on #5146 #4288
Proposed Changes
Makes it so that snapping to the grid happens immediately instead of after a delay.
Reason for Changes
I am working on refactoring how block initialization works. As part of it, I need to have
bumpNeighborsbe triggered by the render management system, instead of being triggered by each individual change that might change the shape of the block.But before
bumpNeighborsgets called, I need to make sure the snap has happened. So I'm getting rid of the delay.Test Coverage
Manually tested that snapping works properly, and looks correct when dropping after dragging.
Documentation
N/A
Additional Information
Dependent on #7743