From 654176ac4795005c6be32655a47c0ccbb0a0dcfe Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 9 Mar 2025 14:18:58 -0400 Subject: [PATCH] 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. --- src/dialogxml/dialogs/dialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dialogxml/dialogs/dialog.cpp b/src/dialogxml/dialogs/dialog.cpp index 60ff3d38..c32e21e7 100644 --- a/src/dialogxml/dialogs/dialog.cpp +++ b/src/dialogxml/dialogs/dialog.cpp @@ -517,7 +517,7 @@ void cDialog::run(std::function 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.