From 29b7301793f5d4775b41f34d490a4d045b22f2d5 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 8 Mar 2021 12:55:45 +0100 Subject: [PATCH] Gui: [skip ci] do not allow image size in About dialog to occupy more than 25% of the screen size --- src/Gui/Splashscreen.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index 2f8f1e2e2d..1d4cfc8eb2 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -247,10 +247,11 @@ AboutDialog::AboutDialog(bool showLic, QWidget* parent) QPixmap image = getMainWindow()->splashImage(); // Make sure the image is not too big - if (image.height() > rect.height()/2 || image.width() > rect.width()/2) { + int denom = 4; + if (image.height() > rect.height()/denom || image.width() > rect.width()/denom) { float scale = static_cast(image.width()) / static_cast(image.height()); - int width = std::min(image.width(), rect.width()/2); - int height = std::min(image.height(), rect.height()/2); + int width = std::min(image.width(), rect.width()/denom); + int height = std::min(image.height(), rect.height()/denom); height = std::min(height, static_cast(width / scale)); width = static_cast(scale * height);