From e532fa443958a557468dd2450bf87a6de83e0f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Thu, 13 Jan 2022 23:12:05 +0100 Subject: [PATCH] Use devicePixelRatioF instead of devicePixelRatio when rendering pages --- YACReader/viewer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/YACReader/viewer.cpp b/YACReader/viewer.cpp index 49259a46..808d535e 100644 --- a/YACReader/viewer.cpp +++ b/YACReader/viewer.cpp @@ -364,10 +364,10 @@ void Viewer::updateContentSize() content->resize(pagefit); // TODO: updtateContentSize should only scale the pixmap once - if (devicePixelRatio() > 1) // only in retina display + if (devicePixelRatioF() > 1) // only in HDPI displays { - QPixmap page = currentPage->scaled(content->width() * devicePixelRatio(), content->height() * devicePixelRatio(), Qt::KeepAspectRatio, Qt::SmoothTransformation); - page.setDevicePixelRatio(devicePixelRatio()); + QPixmap page = currentPage->scaled(content->width() * devicePixelRatioF(), content->height() * devicePixelRatioF(), Qt::KeepAspectRatio, Qt::SmoothTransformation); + page.setDevicePixelRatio(devicePixelRatioF()); content->setPixmap(page); } @@ -1069,9 +1069,9 @@ void Viewer::mousePressEvent(QMouseEvent *event) void Viewer::mouseReleaseEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { - drag = false; - setCursor(Qt::OpenHandCursor); - event->accept(); + drag = false; + setCursor(Qt::OpenHandCursor); + event->accept(); return; }