]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
Avoid duplicating mode changing commands
[lyx.git] / src / BufferView.cpp
index 900114384f738d4f2f4cf8e126f43fd95978e16f..0212b165d1cfd2dd0ed18f06a2886b2a71860872 100644 (file)
@@ -564,6 +564,12 @@ void BufferView::updateScrollbar()
                d->scrollbarParameters_.max -= minVisiblePart();
        else
                d->scrollbarParameters_.max -= d->scrollbarParameters_.page_step;
+
+       // 0 must be inside the range as it denotes the current position
+       if (d->scrollbarParameters_.max < 0)
+               d->scrollbarParameters_.max = 0;
+       if (d->scrollbarParameters_.min > 0)
+               d->scrollbarParameters_.min = 0;
 }