mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 00:58:32 -04:00
added retina support for rendering pages with the right resolution in YACReader
This commit is contained in:
parent
c371e6cc23
commit
bb01aebd69
@ -342,6 +342,18 @@ void Viewer::updateContentSize()
|
||||
content->resize(static_cast<int>(height()*aspectRatio),height());
|
||||
}
|
||||
}
|
||||
|
||||
QPixmap page;
|
||||
if(devicePixelRatio()>1)
|
||||
{
|
||||
page = currentPage->scaled(content->width()*devicePixelRatio(), content->height()*devicePixelRatio(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
page.setDevicePixelRatio(devicePixelRatio());
|
||||
}
|
||||
else
|
||||
page = currentPage->scaled(content->width(), content->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
|
||||
content->setPixmap(page);
|
||||
|
||||
emit backgroundChanges();
|
||||
}
|
||||
content->update(); //TODO, it shouldn't be neccesary
|
||||
@ -765,7 +777,7 @@ void Viewer::setPageUnavailableMessage()
|
||||
void Viewer::configureContent(QString msg)
|
||||
{
|
||||
content->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
|
||||
content->setScaledContents(true);
|
||||
//content->setScaledContents(true);
|
||||
content->setAlignment(Qt::AlignTop|Qt::AlignHCenter);
|
||||
content->setText(msg);
|
||||
content->setFont(QFont("courier new", 12));
|
||||
|
Loading…
x
Reference in New Issue
Block a user