mirror of
https://github.com/YACReader/yacreader
synced 2025-07-21 22:44:56 -04:00
Add zoom and fit to page modes to scaling
This commit is contained in:
@ -316,7 +316,13 @@ void Viewer::updateContentSize()
|
||||
{
|
||||
if(Configuration::getConfiguration().getAdjustToFullSize())
|
||||
{
|
||||
content->resize(currentPage->width(),currentPage->height());
|
||||
content->resize(currentPage->size());
|
||||
}
|
||||
else if(Configuration::getConfiguration().getFitToPage())
|
||||
{
|
||||
QSize pagefit=currentPage->size();
|
||||
pagefit.scale(size(), Qt::KeepAspectRatio);
|
||||
content->resize(pagefit);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -343,6 +349,13 @@ void Viewer::updateContentSize()
|
||||
}
|
||||
}
|
||||
|
||||
if(Configuration::getConfiguration().getPageZoomLevel())
|
||||
{
|
||||
QSize pagesize=content->size();
|
||||
pagesize.scale(content->width()*Configuration::getConfiguration().getPageZoomLevel(), content->height(), Qt::KeepAspectRatio);
|
||||
content->resize(pagesize);
|
||||
}
|
||||
|
||||
if(devicePixelRatio()>1)//only in retina display
|
||||
{
|
||||
QPixmap page = currentPage->scaled(content->width()*devicePixelRatio(), content->height()*devicePixelRatio(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
|
Reference in New Issue
Block a user