mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 13:04:28 -04:00
Add a manga reading mode which displays image in reverse order in double page mode.
The mode is triggered by selecting the "21" double page icon next to the double page icon.
This commit is contained in:
@ -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;
|
||||
@ -1030,6 +1039,16 @@ void Render::doublePageSwitch()
|
||||
}
|
||||
}
|
||||
|
||||
void Render::doubleMangaPageSwitch()
|
||||
{
|
||||
doubleMangaPage = !doubleMangaPage;
|
||||
if(comic&&doublePage)
|
||||
{
|
||||
invalidate();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
QString Render::getCurrentPagesInformation()
|
||||
{
|
||||
QString s = QString::number(currentIndex+1);
|
||||
|
Reference in New Issue
Block a user