Gui: [skip ci] when embedding app icon into thumbnail then only scale it if the offscreen image could be created from the active view

This commit is contained in:
wmayer
2020-11-25 19:43:46 +01:00
parent d69c390a79
commit 4556327416

View File

@@ -99,14 +99,18 @@ void Thumbnail::SaveDocFile (Base::Writer &writer) const
}
// Get app icon and resize to half size to insert in topbottom position over the current view snapshot
QPixmap app_icon = Gui::BitmapFactory().pixmap(App::Application::Config()["AppIcon"].c_str());
QPixmap px = app_icon.scaled(this->size / 4, this->size /4);
QPixmap appIcon = Gui::BitmapFactory().pixmap(App::Application::Config()["AppIcon"].c_str());
QPixmap px = appIcon;
if (!img.isNull()) {
if (App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Document")->GetBool("AddThumbnailLogo",true))
px = BitmapFactory().merge(QPixmap::fromImage(img),px,BitmapFactoryInst::BottomRight);
else
("User parameter:BaseApp/Preferences/Document")->GetBool("AddThumbnailLogo",true)) {
// only scale app icon if an offscreen image could be created
appIcon = appIcon.scaled(this->size / 4, this->size /4);
px = BitmapFactory().merge(QPixmap::fromImage(img), appIcon, BitmapFactoryInst::BottomRight);
}
else {
px = QPixmap::fromImage(img);
}
}
if (!px.isNull()) {