summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmundson <kde@davidedmundson.co.uk>2017-04-23 23:02:05 (GMT)
committerDavid Edmundson <kde@davidedmundson.co.uk>2017-04-23 23:02:05 (GMT)
commit94fb089198784d33f227bfdd2b30eeecf2d7f1e4 (patch)
tree7d4c1c0205f396560748b9479ee5f698b14095e8
parentc67271c0f207720afd85d92ffaa1eaf4841fd8f4 (diff)
Support fractional scailng in KScreen Scaling preview
Summary: Qt 5.something changed to support fractional scaling. I updated the backend code to support that, I never updated the preview UI. Test Plan: Moved the slider, and it looked awesome Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D5412
-rw-r--r--kcm/src/previewwidget.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/kcm/src/previewwidget.cpp b/kcm/src/previewwidget.cpp
index aa236bb..0b3483b 100644
--- a/kcm/src/previewwidget.cpp
+++ b/kcm/src/previewwidget.cpp
@@ -68,16 +68,13 @@ qreal PreviewWidget::pointSizeToPixelSize(qreal pointSize) const
//scale by our new factor
pixelSize *= m_scale;
- int dpr = qRound(m_scale);
- return pixelSize / dpr; //as we are now dealing with pixels it will be scaled up in the paint(), so it needs dividing here
+ return pixelSize / m_scale; //as we are now dealing with pixels it will be scaled up in the paint(), so it needs dividing here
}
QPixmap PreviewWidget::updatePixmapCache()
{
- int dpr = qRound(m_scale);
-
- QPixmap pixmap(m_internalPreview ->sizeHint() * dpr);
- pixmap.setDevicePixelRatio(dpr);
+ QPixmap pixmap(m_internalPreview ->sizeHint() * m_scale);
+ pixmap.setDevicePixelRatio(m_scale);
QPainter p(&pixmap);
m_internalPreview ->render(&p);