-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Proper Pane Grid spacing #361
Conversation
On low-DPI screens, the rounding order of operations made it impossible to produce an odd-pixel spacing. Specifying 1, for instance, produced zero space between panes. This approach subtracts half the spacing from the first pane prior to rounding and uses the whole spacing for the second pane size and coordinate.
57010df
to
334dd09
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
On low-DPI screens, the rounding order of operations made it impossible to produce an odd-pixel spacing. Specifying 1, for instance, produced zero space between panes.
I believe the spacing was there but, as the halved_spacing
was subtracted after rounding, the resulting rectangles were not aligned to the logical pixel grid. This can happen as part of layouting, so it shouldn't be a problem!
The changes here align the bounds to the logical grid after subtracting the spacing. This is more desirable because it's easier for the renderer to target physical pixels when dealing with an integral scale factor. However, it won't fix the issue when using a non-integral one.
Thus, the real underlying problem remains unsolved: targetting physical pixels when the rendering primitives do not align perfectly with the pixel grid (clamping?). The fix should probably happen in the quad
rendering pipeline in iced_wgpu
. I will try to play with it.
Might be a configuration option. SVG has the
|
@clarkmoody I believe quads should always be pixel-aligned, independently of the anti-aliasing strategy. They are GUI rendering primitives that should always be crisp. The I have opened #362 which should fix the main issue here. I still believe we should merge this, though! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you 🎉
On low-DPI screens, the rounding order of operations made it impossible to produce an odd-pixel spacing. Specifying 1, for instance, produced zero space between panes.
This approach subtracts half the spacing from the first pane prior to rounding and uses the whole spacing for the second pane size and coordinate.
We're no longer pre-computing the
halved_spacing
and passing that around. RatherAxis::split
operates on the full spacing.