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());
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;