Skip to content

fix: snap immediately#7745

Merged
BeksOmega merged 1 commit intoRaspberryPiFoundation:v11-breaksfrom
BeksOmega:fix/snap-immediately
Jan 9, 2024
Merged

fix: snap immediately#7745
BeksOmega merged 1 commit intoRaspberryPiFoundation:v11-breaksfrom
BeksOmega:fix/snap-immediately

Conversation

@BeksOmega
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator

@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
Copy Markdown
Collaborator

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
Copy Markdown
Contributor 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 RaspberryPiFoundation:v11-breaks Jan 9, 2024
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