Merged luisangelsm/yacreader into default

This commit is contained in:
Felix Kauselmann
2014-08-12 12:56:01 +02:00
13 changed files with 139 additions and 66 deletions

View File

@ -453,11 +453,20 @@ void DoublePageRender::run()
QImage auxImg(totalWidth,totalHeight,QImage::Format_RGB32);
QPainter painter(&auxImg);
painter.drawImage(QRect(0,0,width1,totalHeight),img);
if(!img2.isNull())
painter.drawImage(QRect(width1,0,width2,totalHeight),img2);
painter.end();
if (render->doubleMangaPage) {
qDebug() << "we are in the double Manga Page tree" << render->doubleMangaPage;
painter.drawImage(QRect(width2,0,width1,totalHeight),img);
if(!img2.isNull())
painter.drawImage(QRect(0,0,width2,totalHeight),img2);
painter.end();
}
else {
qDebug() << "no double Manga Page" << render->doubleMangaPage;
painter.drawImage(QRect(0,0,width1,totalHeight),img);
if(!img2.isNull())
painter.drawImage(QRect(width1,0,width2,totalHeight),img2);
painter.end();
}
if(degrees > 0)
{
QMatrix m;
@ -479,7 +488,7 @@ void DoublePageRender::run()
//-----------------------------------------------------------------------------
Render::Render()
:currentIndex(0),doublePage(false),comic(0),loadedComic(false),imageRotation(0),numLeftPages(2),numRightPages(2)
:currentIndex(0),doublePage(false),doubleMangaPage(false),comic(0),loadedComic(false),imageRotation(0),numLeftPages(2),numRightPages(2)
{
int size = numLeftPages+numRightPages+1;
currentPageBufferedIndex = numLeftPages;
@ -1036,11 +1045,26 @@ void Render::doublePageSwitch()
}
}
void Render::doubleMangaPageSwitch()
{
doubleMangaPage = !doubleMangaPage;
if(comic&&doublePage)
{
invalidate();
update();
}
}
QString Render::getCurrentPagesInformation()
{
QString s = QString::number(currentIndex+1);
if (doublePage && (currentIndex+1 < (int)comic->numPages()))
s += "-"+QString::number(currentIndex+2);
{
if (doubleMangaPage)
s = QString::number(currentIndex+2) + "-" + s;
else
s += "-"+QString::number(currentIndex+2);
}
s += "/"+QString::number(comic->numPages());
return s;
}