Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: snap immediately #7745

Merged
merged 1 commit into from
Jan 9, 2024
Merged

Conversation

BeksOmega
Copy link
Collaborator

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 bumpNeighbors be triggered by the render management system, instead of being triggered by each individual change that might change the shape of the block.

But before bumpNeighbors gets 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

@BeksOmega BeksOmega requested a review from a team as a code owner January 4, 2024 19:23
@BeksOmega BeksOmega requested a review from cpcallen January 4, 2024 19:23
@github-actions github-actions bot added the PR: fix Fixes a bug label Jan 4, 2024
@BeksOmega BeksOmega marked this pull request as draft January 4, 2024 19:24
@BeksOmega BeksOmega mentioned this pull request Jan 4, 2024
1 task
Copy link
Contributor

@cpcallen cpcallen left a comment

Choose a reason for hiding this comment

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

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.
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it safe to remove this check?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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.

@BeksOmega BeksOmega changed the base branch from rc/v11.0.0 to v11-breaks January 8, 2024 22:24
@github-actions github-actions bot removed the PR: fix Fixes a bug label Jan 8, 2024
@BeksOmega BeksOmega marked this pull request as ready for review January 8, 2024 22:24
@github-actions github-actions bot added the PR: fix Fixes a bug label Jan 8, 2024
@BeksOmega BeksOmega force-pushed the fix/snap-immediately branch from c9610ca to c80bf82 Compare January 8, 2024 22:25
@BeksOmega BeksOmega merged commit 1e5ff14 into google:v11-breaks Jan 9, 2024
6 checks passed
BeksOmega added a commit that referenced this pull request Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants