mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 04:54:29 -04:00
Use devicePixelRatioF instead of devicePixelRatio when rendering pages
This commit is contained in:
@ -364,10 +364,10 @@ void Viewer::updateContentSize()
|
|||||||
content->resize(pagefit);
|
content->resize(pagefit);
|
||||||
|
|
||||||
// TODO: updtateContentSize should only scale the pixmap once
|
// 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);
|
QPixmap page = currentPage->scaled(content->width() * devicePixelRatioF(), content->height() * devicePixelRatioF(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
page.setDevicePixelRatio(devicePixelRatio());
|
page.setDevicePixelRatio(devicePixelRatioF());
|
||||||
content->setPixmap(page);
|
content->setPixmap(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1069,9 +1069,9 @@ void Viewer::mousePressEvent(QMouseEvent *event)
|
|||||||
void Viewer::mouseReleaseEvent(QMouseEvent *event)
|
void Viewer::mouseReleaseEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton) {
|
if (event->button() == Qt::LeftButton) {
|
||||||
drag = false;
|
drag = false;
|
||||||
setCursor(Qt::OpenHandCursor);
|
setCursor(Qt::OpenHandCursor);
|
||||||
event->accept();
|
event->accept();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user