Menu

#232 display problem when a page is much larger than its next

djview
closed
nobody
None
5
2014-04-06
2014-03-29
tarlou
No

If the first page is much much larger than the second page, when scroll down from the first page, it can be the case that no page is visible (the 1st page is above the top of the window, the 2nd page is outside the left edge of the window).
When this happens, the screen shakes between an error picture and the 1st page (at wrong position).
I debugged a bit, and I think there are problems when pageVisible (member of QDjVuPrivate) is empty. Both QDjVuPrivate::findPosition and QDjVuPrivate::paintAll have problems when it is empty.

Here is a workaround that seems to work. No idea how good it is as I don't fully understand the code. Add the following lines after line 1428 of src/qdjvuwidget.cpp (revision 5809d9).
// To ensure pageVisible is non-empty
// Add a page that intesects rv, by comparing only in the vertical direction instead of rect intersection
if (pageVisible.isEmpty()) {
foreach(p, pageLayout)
if (rv.top() <= p->rect.bottom() && rv.bottom() >= p->rect.top()) {
pageVisible.append(p);
break;
}
}

Discussion

  • Leon Bottou

    Leon Bottou - 2014-04-06
    • status: open --> closed
     
  • Leon Bottou

    Leon Bottou - 2014-04-06

    I believe this has been fixed.
    Please reopen if needed.

     

Log in to post a comment.