Ensure that thumbnails do not get larger than the window
Upscaling windows looks really bad. If the thumbnail gets larger than the window it's better to just use the orignal window size and have the thumbnail rendered centered in the requested region. BUG: 297864 FIXED-IN: 4.9.0 REVIEW: 105459
This commit is contained in:
parent
3125333f76
commit
830c17eebb
1 changed files with 3 additions and 0 deletions
|
@ -364,6 +364,9 @@ void Scene::paintWindow(Window* w, int mask, QRegion region, WindowQuadList quad
|
|||
|
||||
QSizeF size = QSizeF(thumb->size());
|
||||
size.scale(QSizeF(item->width(), item->height()), Qt::KeepAspectRatio);
|
||||
if (size.width() > thumb->width() || size.height() > thumb->height()) {
|
||||
size = QSizeF(thumb->size());
|
||||
}
|
||||
thumbData.xScale = size.width() / static_cast<qreal>(thumb->width());
|
||||
thumbData.yScale = size.height() / static_cast<qreal>(thumb->height());
|
||||
// it can happen in the init/closing phase of the tabbox
|
||||
|
|
Loading…
Reference in a new issue