From eac56d6f83f14b11232264f6acb6f7a1cacd1d71 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 4 Jul 2007 01:46:02 +0200 Subject: [PATCH] Fix navigation in twoPagesSpread mode --- src/comicmain.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/comicmain.cpp b/src/comicmain.cpp index 9567c7d..c0c867d 100644 --- a/src/comicmain.cpp +++ b/src/comicmain.cpp @@ -838,15 +838,6 @@ void ComicMainWindow::jumpToPage(int n, bool force) if (twoPagesAction->isOn()) { - img2 = sink->getImage(currpage + (++page_off), result2); - - if (result2 == 0 && img2->getFormat() == STRIP_FORMAT && stripModeAction->isOn()) { - list[0].append(img1); - nextpage = buildStripList(currpage+page_off, img2, &(list[1]), false); - jumpToStrip(n, list, true); - return; - } - // If the first page is a spread and we consider spreads as // two pages, skip loading a second page and mark this if (img1->getFormat() == SPREAD_FORMAT && cfg->twoPagesSpread()) @@ -857,8 +848,18 @@ void ComicMainWindow::jumpToPage(int n, bool force) else { spreading = false; + + img2 = sink->getImage(currpage + (++page_off), result2); + + if (result2 == 0 && img2->getFormat() == STRIP_FORMAT && stripModeAction->isOn()) { + list[0].append(img1); + nextpage = buildStripList(currpage+page_off, img2, &(list[1]), false); + jumpToStrip(n, list, true); + return; + } } + // If the second page is a spread, and we consider spreads as // two pages, there are two possible ways of handling the lone // first page: either we display it alone, or we display it @@ -873,17 +874,21 @@ void ComicMainWindow::jumpToPage(int n, bool force) { if (cfg->twoPagesSkip()) { // Skip spreads: + int save_page_off = page_off; while (result2 == 0 && img2->getFormat() == SPREAD_FORMAT) { delete img2; img2 = sink->getImage(currpage + (++page_off), result2); spreading = true; } + page_off = save_page_off - 1; // Reset counter for next page } else { // Stop at spreads: result2 = 1; spreading = true; + delete img2; + --page_off; // Reset counter for next page } } -- 2.32.0.93.g670b81a890