mirror of
https://github.com/YACReader/yacreader
synced 2025-07-25 08:25:03 -04:00
undo misplaced changeset
This commit is contained in:
@ -340,16 +340,9 @@ void Viewer::updateContentSize()
|
||||
}
|
||||
else
|
||||
{
|
||||
//float aspectRatio = (float)currentPage->width()/currentPage->height();
|
||||
float aspectRatio = (float)currentPage->width()/currentPage->height();
|
||||
//Fit to width
|
||||
if(Configuration::getConfiguration().getAdjustToWidth())
|
||||
{
|
||||
QSize pagefit=currentPage->size();
|
||||
pagefit.scale(width(), 0, Qt::KeepAspectRatioByExpanding);
|
||||
content->resize(pagefit);
|
||||
}
|
||||
/*
|
||||
if(Configuration::getConfiguration().getAdjustToWidth())
|
||||
{
|
||||
adjustToWidthRatio = Configuration::getConfiguration().getFitToWidthRatio();
|
||||
if(static_cast<int>(width()*adjustToWidthRatio/aspectRatio)<height())
|
||||
@ -360,7 +353,6 @@ void Viewer::updateContentSize()
|
||||
else
|
||||
content->resize(width()*adjustToWidthRatio,static_cast<int>(width()*adjustToWidthRatio/aspectRatio));
|
||||
}
|
||||
|
||||
//Fit to height or fullsize/custom size
|
||||
else
|
||||
{
|
||||
@ -368,26 +360,18 @@ void Viewer::updateContentSize()
|
||||
content->resize(width(),static_cast<int>(width()/aspectRatio));
|
||||
else
|
||||
content->resize(static_cast<int>(height()*aspectRatio),height());
|
||||
}*/
|
||||
else
|
||||
{
|
||||
QSize pagefit=currentPage->size();
|
||||
pagefit.scale(0, height(), Qt::KeepAspectRatioByExpanding);
|
||||
content->resize(pagefit);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(Configuration::getConfiguration().getPageZoomLevel())
|
||||
{
|
||||
QSize pagesize=content->size();
|
||||
pagesize.scale(content->width()*Configuration::getConfiguration().getPageZoomLevel(), 0, Qt::KeepAspectRatioByExpanding);
|
||||
pagesize.scale(content->width()*Configuration::getConfiguration().getPageZoomLevel(), content->height(), Qt::KeepAspectRatio);
|
||||
content->resize(pagesize);
|
||||
}
|
||||
|
||||
if(devicePixelRatio()>1)//only in retina display
|
||||
{
|
||||
qDebug() << "Retina Display detected" << "devicePixelRatio:" << devicePixelRatio();
|
||||
QPixmap page = currentPage->scaled(content->width()*devicePixelRatio(), content->height()*devicePixelRatio(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
page.setDevicePixelRatio(devicePixelRatio());
|
||||
content->setPixmap(page);
|
||||
|
Reference in New Issue
Block a user