Commit f76e555c authored by Christoph Feck's avatar Christoph Feck
Browse files

Fix HiDPI support

Adjust the centering shift based on the device scale factor.
Also enable HiDPI icons.

BUG: 394308
FIXED-IN: 18.04.3

Reviewed by: davidedmundson

Differential Revision: https://phabricator.kde.org/D13391
parent 389b60a1
......@@ -327,7 +327,8 @@ void KMagZoomView::paintEvent(QPaintEvent *e)
p.translate(visibleWidth() / 2.0, visibleHeight() / 2.0);
p.setMatrix(m_zoomMatrix, true);
p.translate(-m_coloredPixmap.width() / 2.0, -m_coloredPixmap.height() / 2.0);
const double ratio = 0.5 / m_coloredPixmap.devicePixelRatio();
p.translate(-m_coloredPixmap.width() * ratio, -m_coloredPixmap.height() * ratio);
p.drawPixmap(QPoint(clipx-contentsX(), clipy-contentsY()), m_coloredPixmap);
p.end();
......
......@@ -38,6 +38,7 @@ KmagApp *kmagapp;
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
KLocalizedString::setApplicationDomain("kmag");
// about the application
......
Supports Markdown
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