Use percentage of screen size as padding (#5123)
This commit is contained in:
@@ -558,14 +558,13 @@ void Menu::DrawElement() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Full screen menu with widths below 1280, heights below 800.
|
// Full screen menu with widths below 1280, heights below 800.
|
||||||
// Up to 100 pixel padding when up to 1700 width, 1050 height.
|
// 5% of screen width/height padding on both sides above those resolutions.
|
||||||
// Everything above that, fixed size of 1600x950.
|
|
||||||
ImVec2 menuSize = { std::fminf(1280, windowWidth), std::fminf(800, windowHeight) };
|
ImVec2 menuSize = { std::fminf(1280, windowWidth), std::fminf(800, windowHeight) };
|
||||||
if (windowWidth > 1380) {
|
if (windowWidth > 1280) {
|
||||||
menuSize.x = std::fminf(1600, windowWidth - 100);
|
menuSize.x = floor(windowWidth * 0.9);
|
||||||
}
|
}
|
||||||
if (windowHeight > 900) {
|
if (windowHeight > 800) {
|
||||||
menuSize.y = std::fminf(950, windowHeight - 100);
|
menuSize.y = floor(windowHeight * 0.9);
|
||||||
}
|
}
|
||||||
|
|
||||||
pos += window->WorkRect.GetSize() / 2 - menuSize / 2;
|
pos += window->WorkRect.GetSize() / 2 - menuSize / 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user