Gui: [skip ci] do not allow image size in About dialog to occupy more than 25% of the screen size
This commit is contained in:
@@ -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<float>(image.width()) / static_cast<float>(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<int>(width / scale));
|
||||
width = static_cast<int>(scale * height);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user