undo misplaced changeset

This commit is contained in:
Felix Kauselmann
2015-09-08 11:01:48 +02:00
parent ceb4e81e3c
commit f2f78b1542
3 changed files with 8 additions and 57 deletions

View File

@ -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);