mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
extra rendering only takes place if we are in retina mode HDPI
This commit is contained in:
parent
bb01aebd69
commit
9eba11f343
@ -343,16 +343,12 @@ void Viewer::updateContentSize()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap page;
|
if(devicePixelRatio()>1)//only in retina display
|
||||||
if(devicePixelRatio()>1)
|
|
||||||
{
|
{
|
||||||
page = currentPage->scaled(content->width()*devicePixelRatio(), content->height()*devicePixelRatio(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
QPixmap page = currentPage->scaled(content->width()*devicePixelRatio(), content->height()*devicePixelRatio(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
page.setDevicePixelRatio(devicePixelRatio());
|
page.setDevicePixelRatio(devicePixelRatio());
|
||||||
|
content->setPixmap(page);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
page = currentPage->scaled(content->width(), content->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
|
||||||
|
|
||||||
content->setPixmap(page);
|
|
||||||
|
|
||||||
emit backgroundChanges();
|
emit backgroundChanges();
|
||||||
}
|
}
|
||||||
@ -777,7 +773,8 @@ void Viewer::setPageUnavailableMessage()
|
|||||||
void Viewer::configureContent(QString msg)
|
void Viewer::configureContent(QString msg)
|
||||||
{
|
{
|
||||||
content->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
|
content->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
|
||||||
//content->setScaledContents(true);
|
if(!(devicePixelRatio()>1))
|
||||||
|
content->setScaledContents(true);
|
||||||
content->setAlignment(Qt::AlignTop|Qt::AlignHCenter);
|
content->setAlignment(Qt::AlignTop|Qt::AlignHCenter);
|
||||||
content->setText(msg);
|
content->setText(msg);
|
||||||
content->setFont(QFont("courier new", 12));
|
content->setFont(QFont("courier new", 12));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user