Skip to content

Fix rounding in the pixel_grid_snap example#24358

Merged
mockersf merged 1 commit into
bevyengine:mainfrom
ethanuppal:fix-rounding-in-pixel_grid_snap
May 21, 2026
Merged

Fix rounding in the pixel_grid_snap example#24358
mockersf merged 1 commit into
bevyengine:mainfrom
ethanuppal:fix-rounding-in-pixel_grid_snap

Conversation

@ethanuppal
Copy link
Copy Markdown

Objective

Fixes #24350

Solution

I replaced round with floor as mentioned in the issue.

Testing

  • Did you test these changes? If so, how?

I ran the program on my computer and observed the change.

  • Are there any parts that need more testing?

Perhaps other display sizes need testing, but theoretically the math should be correct. This is my first PR, so I might have missed something.

  • How can other people (reviewers) test your changes? Is there anything specific they need to know?

Compare the clipping on window sizes that are a multiple of the canvas's resolution to those that are not.

  • If relevant, what platforms did you test these changes on, and are there any important ones you can't test?

I tested on macOS; I cannot test on any other platform.


Showcase

Click to view showcase Screenshot 2026-05-19 at 3 14 25 AM Screenshot 2026-05-19 at 12 50 52 AM

Signed-off-by: Ethan Uppal <113849268+ethanuppal@users.noreply.github.com>
@ethanuppal ethanuppal changed the title Fix rounding in the pixel_grid_snap example Fix rounding in the pixel_grid_snap example May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨

@kfc35 kfc35 added C-Examples An addition or correction to our examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Trivial Nice and easy! A great choice to get started with Bevy labels May 20, 2026
@kfc35 kfc35 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 20, 2026
@mockersf mockersf added this pull request to the merge queue May 21, 2026
Copy link
Copy Markdown

@ncthbrt ncthbrt left a comment

Choose a reason for hiding this comment

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

LGTM. Makes sense and small, non-invasive change

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 21, 2026
@mockersf mockersf added this pull request to the merge queue May 21, 2026
Merged via the queue into bevyengine:main with commit b556c9d May 21, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Examples An addition or correction to our examples D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect rounding in the pixel_grid_snap example

4 participants