-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Sugarloaf examples do not render correctly on Linux #50
Comments
Hey there @Cthutu , yes I am aware (unfortunately). Same behaviour happens in the macos when having an external monitor with a scale factor different than 2.0. The initial render of sugarloaf has a hardcoded logic to start calculating layouts with 2.0, this need to be fixed. Rect is the only case that's correct because doesn't the scale calculation. |
I plan to look on that soon, but feel free to send a PR as well 🙏 |
Hey @Cthutu pushed a correction for those issues in 3b482ff. Please pull latest main and check if still happens. I will close this issue after validate the fix with @filaruina |
Your changes fixes the first issue (woohoo!). However, it doesn't render correctly on a tiled window manager (the window opens at the usual size then immediately gets resized and repositioned by the desktop manager) or when you resize the window (e.g. maximising). I think this is just because you don't redraw on resize in the demo? I haven't had enough time lately to get to the bottom of it. |
If you want pixel perfect you should be using PhysicalSize. If you want to take into account the user's settings for monitor scale factors etc, LogicalSize is your friend. |
Yea, I like LogicalSize for the terminal as an user application but thinking in enable it as configuration option, then you can choose what fits better for your case. |
Great, thank you @filaruina for testing it too ! |
I am using the latest Pop_OS! distribution and tried to run the sugarloaf example "text.rs". I hit 2 issues:
It render incorrectly:
Maximising or resizing the window did not cause a redraw so the extra space was not rendered to. This means on a tiling window manager, nothing was rendered at all (perhaps off window?).
The text was updated successfully, but these errors were encountered: