Bug 110727 - mouse-wheel scrolling: first page scrolls upwards to first page, last page scrolls downwards to last page
Summary: mouse-wheel scrolling: first page scrolls upwards to first page, last page sc...
Status: RESOLVED FIXED
Alias: None
Product: kdvi
Classification: Miscellaneous
Component: general (show other bugs)
Version: 1.3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Stefan Kebekus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-13 22:39 UTC by Daniel Franke
Modified: 2019-07-29 19:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
everytime i have to change my password (35.68 KB, image/jpeg)
2019-07-29 19:50 UTC, feri
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Franke 2005-08-13 22:39:38 UTC
Version:           1.3 (using KDE 3.4.2, Gentoo)
Compiler:          gcc version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1)
OS:                Linux (i686) release 2.6.11.11

Open a dvi that has at least two pages, zoom in (to amplify the effect), go to page 2, use your mouse wheel to scroll upwards ... keep scrolling .. scroll on ... eventually the first page scroll onto the first page (start from bottom). If you keep scrolling, so will kdvi. The same happens with the last page if scrolling downwards (starts from top). Page-Up/Page-Down keys are not affected.
Comment 1 Daniel Franke 2005-08-14 01:55:12 UTC
In addition, I just found that it's not possible to scroll from page n-1 to page n in a n-page document. 
Comment 2 Wilfried Huss 2005-08-15 13:28:50 UTC
SVN commit 449385 by whuss:

Fix mousewheel scrolling in single page mode.

BUG:110727

 M  +7 -5      kmultipage.cpp  


--- branches/KDE/3.5/kdegraphics/kviewshell/kmultipage.cpp #449384:449385
@@ -1149,9 +1149,11 @@
   Q_UINT8 cols = scrollView()->getNrColumns();
   Q_UINT8 rows = scrollView()->getNrRows();
 
-  Q_UINT16 np = 0;
+  PageNumber np = 1;
   if (cols*rows < currentPageNumber())
+  {
     np = currentPageNumber() - cols*rows;
+  }
 
   gotoPage(np);
 }
@@ -1162,7 +1164,7 @@
   Q_UINT8 cols = scrollView()->getNrColumns();
   Q_UINT8 rows = scrollView()->getNrRows();
 
-  Q_UINT16 np = QMIN(currentPageNumber() + cols*rows, (Q_UINT16)numberOfPages());
+  PageNumber np = QMIN(currentPageNumber() + cols*rows, (Q_UINT16)numberOfPages());
 
   gotoPage(np);
 }
@@ -1190,15 +1192,15 @@
 
   if (deltaInPixel < 0) {
     if (scrollBar->value() == scrollBar->minValue()) {
-      if ( (currentPageNumber() == 0) || (changePageDelayTimer.isActive()) )
+      if ( (currentPageNumber() == 1) || (changePageDelayTimer.isActive()) )
         return;
 
       if (scrollView()->isContinuous())
         return;
 
       changePageDelayTimer.stop();
+      prevPage();
 
-      prevPage();
       scrollView()->setContentsPos(scrollView()->contentsX(), scrollBar->maxValue());
       return;
     }
@@ -1206,7 +1208,7 @@
 
   if (deltaInPixel > 0) {
     if (scrollBar->value() == scrollBar->maxValue()) {
-      if ( (currentPageNumber() + 1 == numberOfPages()) || (changePageDelayTimer.isActive()) )
+      if ( (currentPageNumber() == numberOfPages()) || (changePageDelayTimer.isActive()) )
         return;
 
       if (scrollView()->isContinuous())
Comment 3 Wilfried Huss 2005-08-15 13:36:23 UTC
Thank you, for your bugreport.

The regression you noticed was caused by a change of the internal numbering
scheme of pages we did a while ago, that caused many off by one errors.
Apparently we haven't found all of them yet.

Anyway, the bug will be fixed in KDE 3.5, and in KDE 3.4.3 (if such a release
will happen).

Greetings,
Wilfried Huss.
Comment 4 Daniel Franke 2005-08-15 17:24:25 UTC
Fast fix, thanks a lot =)
Daniel
Comment 5 feri 2019-07-29 19:50:07 UTC
Created attachment 121817 [details]
everytime i have to change my password