Skip to content

Align quads to physical pixels in iced_wgpu#362

Merged
hecrj merged 1 commit into
masterfrom
fix/target-quad-pixels
May 28, 2020
Merged

Align quads to physical pixels in iced_wgpu#362
hecrj merged 1 commit into
masterfrom
fix/target-quad-pixels

Conversation

@hecrj
Copy link
Copy Markdown
Member

@hecrj hecrj commented May 26, 2020

This PR aligns Quad primitives to the pixel grid in iced_wgpu by flooring the position, size, and border width.

As a consequence, quads will look crisp independently of the scale factor. For instance, here is what the tour slider looked like with a scale factor of 1.1666...7:

image

And here is what it looks like now:

image

The main downside is that quads will now be more "jumpy" and relative spacing may change slightly in different screens, specially when using non-integral scale factors.

@hecrj hecrj added bug Something isn't working improvement An internal improvement labels May 26, 2020
@hecrj hecrj added this to the 0.2.0 milestone May 26, 2020
@hecrj hecrj self-assigned this May 26, 2020
@hecrj hecrj mentioned this pull request May 26, 2020
@hecrj hecrj merged commit 40501f6 into master May 28, 2020
@hecrj hecrj deleted the fix/target-quad-pixels branch May 28, 2020 01:20
hecrj added a commit that referenced this pull request May 28, 2020
This reverts commit 40501f6, reversing
changes made to 5324eb1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working improvement An internal improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant