]> git.lyx.org Git - features.git/commitdiff
* BufferView::scrollDocView(): take care of the general case before the particular...
authorAbdelrazak Younes <younes@lyx.org>
Tue, 29 Jan 2008 13:34:18 +0000 (13:34 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 29 Jan 2008 13:34:18 +0000 (13:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22710 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp

index d632b12177753d6933efe11b5d042e82b6af39b3..9edd183157e5309333d5d98bfc10818167e29bf9 100644 (file)
@@ -501,6 +501,13 @@ docstring BufferView::contextMenu(int x, int y) const
 
 void BufferView::scrollDocView(int value)
 {
+       int const offset = value - d->scrollbarParameters_.position;
+       // If the offset is less than 2 screen height, prefer to scroll instead.
+       if (abs(offset) <= 2 * height_) {
+               scroll(offset);
+               return;
+       }
+
        // cut off at the top
        if (value <= d->scrollbarParameters_.min) {
                DocIterator dit = doc_iterator_begin(buffer_.inset());
@@ -518,14 +525,6 @@ void BufferView::scrollDocView(int value)
                return;
        }
 
-
-       int const offset = value - d->scrollbarParameters_.position;
-       // If the offset is less than 2 screen height, prefer to scroll instead.
-       if (abs(offset) <= 2 * height_) {
-               scroll(offset);
-               return;
-       }
-
        // find paragraph at target position
        int par_pos = d->scrollbarParameters_.min;
        pit_type i = 0;