Add bare metal zoom handling to viewer

This commit is contained in:
Felix Kauselmann
2015-12-02 15:38:58 +01:00
parent 3ad70c39fb
commit acc912a765
2 changed files with 19 additions and 10 deletions

View File

@ -38,7 +38,8 @@ restoreMagnifyingGlass(false),
drag(false),
numScrollSteps(22),
shouldOpenNext(false),
shouldOpenPrevious(false)
shouldOpenPrevious(false),
zoom(1)
{
translator = new YACReaderTranslator(this);
translator->hide();
@ -350,6 +351,11 @@ void Viewer::updateContentSize()
pagefit.scale(size(), Qt::KeepAspectRatio);
break;
}
if(zoom != 1)
{
pagefit.scale(pagefit.width()*zoom, 0, Qt::KeepAspectRatioByExpanding);
}
//apply scaling
content->resize(pagefit);

View File

@ -96,6 +96,9 @@ virtual void mouseReleaseEvent ( QMouseEvent * event );
bool information;
bool doublePage;
bool doubleMangaPage;
qreal zoom;
PageLabelWidget * informationLabel;
//QTimer * scroller;
QPropertyAnimation * verticalScroller;