mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-31 03:50:37 -07:00
Use percentage of screen size as padding (#5123)
This commit is contained in:
parent
05ab17d3a8
commit
f3b3e0f5eb
1 changed files with 5 additions and 6 deletions
|
@ -558,14 +558,13 @@ void Menu::DrawElement() {
|
|||
}
|
||||
|
||||
// Full screen menu with widths below 1280, heights below 800.
|
||||
// Up to 100 pixel padding when up to 1700 width, 1050 height.
|
||||
// Everything above that, fixed size of 1600x950.
|
||||
// 5% of screen width/height padding on both sides above those resolutions.
|
||||
ImVec2 menuSize = { std::fminf(1280, windowWidth), std::fminf(800, windowHeight) };
|
||||
if (windowWidth > 1380) {
|
||||
menuSize.x = std::fminf(1600, windowWidth - 100);
|
||||
if (windowWidth > 1280) {
|
||||
menuSize.x = floor(windowWidth * 0.9);
|
||||
}
|
||||
if (windowHeight > 900) {
|
||||
menuSize.y = std::fminf(950, windowHeight - 100);
|
||||
if (windowHeight > 800) {
|
||||
menuSize.y = floor(windowHeight * 0.9);
|
||||
}
|
||||
|
||||
pos += window->WorkRect.GetSize() / 2 - menuSize / 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue