Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Scale HUD proportionally when resizing window #15

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

JuanPotato
Copy link
Contributor

@JuanPotato JuanPotato commented Oct 31, 2021

Did a lot of debatable things in here, please roast.
image
scales well now, fixes #9

src/hud/debug_hud.rs Outdated Show resolved Hide resolved
src/hud/debug_hud.rs Outdated Show resolved Hide resolved
src/hud/debug_hud.rs Outdated Show resolved Hide resolved
Comment on lines 30 to 31
ui_scale_x: 0.0,
ui_scale_y: 0.0,
Copy link
Owner

Choose a reason for hiding this comment

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

Perhaps it'd be nice to default these to the UI_SCALE_{X,Y} constants? That'll make sure that WidgetsHud is in an operable state right after new'ing it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Trying to think of a way to only need to set the aspect ratio instead of scale_x and scale_y

Copy link
Owner

Choose a reason for hiding this comment

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

That sounds even better

Copy link
Contributor Author

@JuanPotato JuanPotato Oct 31, 2021

Choose a reason for hiding this comment

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

scale_x is just used in so many places and that would be replaced by scale_y / ratio which wouldn't actually work if we want to support the toolbar shrinking when the window width is too small. Currently I check if the toolbar would be clipped and then shrink it. We could just ignore that case

src/hud/mod.rs Outdated Show resolved Hide resolved
vijfhoek and others added 2 commits November 1, 2021 01:15
Co-authored-by: Sijmen <me@vijf.life>
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

text and toolbar don't maintain aspect ratio when scaling
2 participants