Make the dialog size sanity check give a little leeway for dialogs that don't quite fit on the screen.

Otherwise, you can't even use the preferences to set the scaling factor back down if it was set so high that the preferences don't fit.
This commit is contained in:
2025-03-09 14:18:58 -04:00
committed by Celtic Minstrel
parent cbf7cc8388
commit 654176ac47

View File

@@ -517,7 +517,7 @@ void cDialog::run(std::function<void(cDialog&)> onopen){
}
// Make sure the requested size isn't insane.
auto desktop = sf::VideoMode::getDesktopMode();
if(winRect.width() > desktop.width || winRect.height() > desktop.height) {
if(winRect.width() > desktop.width * 1.5 || winRect.height() > desktop.height * 1.5) {
throw std::string("Dialog ") + fname + std::string(" requested a crazy window size of ") + std::to_string(winRect.width()) + "x" + std::to_string(winRect.height());
}
// Sometimes it seems like the Cocoa menu handling clobbers the active rendering context.