Commit 8daf7e7a authored by Martin Flöser's avatar Martin Flöser
Browse files

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
parent 2697a273
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment