mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Merge branch 'KDE/4.14'
This commit is contained in:
commit
9203fdc4d9
|
@ -102,11 +102,13 @@ void PixmapViewer::paintEvent(QPaintEvent* event)
|
||||||
const bool useOldPixmap = (m_transition == SizeTransition) &&
|
const bool useOldPixmap = (m_transition == SizeTransition) &&
|
||||||
(m_oldPixmap.width() > m_pixmap.width());
|
(m_oldPixmap.width() > m_pixmap.width());
|
||||||
const QPixmap& largePixmap = useOldPixmap ? m_oldPixmap : m_pixmap;
|
const QPixmap& largePixmap = useOldPixmap ? m_oldPixmap : m_pixmap;
|
||||||
const QPixmap scaledPixmap = largePixmap.scaled(scaledWidth,
|
if (!largePixmap.isNull()) {
|
||||||
scaledHeight,
|
const QPixmap scaledPixmap = largePixmap.scaled(scaledWidth,
|
||||||
Qt::IgnoreAspectRatio,
|
scaledHeight,
|
||||||
Qt::FastTransformation);
|
Qt::IgnoreAspectRatio,
|
||||||
painter.drawPixmap(x, y, scaledPixmap);
|
Qt::FastTransformation);
|
||||||
|
painter.drawPixmap(x, y, scaledPixmap);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const int x = (width() - m_pixmap.width() ) / 2;
|
const int x = (width() - m_pixmap.width() ) / 2;
|
||||||
const int y = (height() - m_pixmap.height()) / 2;
|
const int y = (height() - m_pixmap.height()) / 2;
|
||||||
|
|
Loading…
Reference in a new issue