]> git.lyx.org Git - lyx.git/commitdiff
* save one redraw on each change of the scrollbar.
authorStefan Schimanski <sts@lyx.org>
Sat, 15 Nov 2008 18:17:20 +0000 (18:17 +0000)
committerStefan Schimanski <sts@lyx.org>
Sat, 15 Nov 2008 18:17:20 +0000 (18:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27471 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp

index 0bb341ac301e765bffb0d8168c723470c1d8e813..8d8c7e69757629478e8ff5abdfd6d2b5ce38b073 100644 (file)
@@ -549,9 +549,14 @@ docstring BufferView::contextMenu(int x, int y) const
 void BufferView::scrollDocView(int value)
 {
        int const offset = value - d->scrollbarParameters_.position;
+
+       // No scrolling at all? No need to redraw anything
+       if (offset == 0)
+               return;
+
        // If the offset is less than 2 screen height, prefer to scroll instead.
        if (abs(offset) <= 2 * height_) {
-               scroll(offset);
+               d->anchor_ypos_ -= offset;
                updateMetrics();
                buffer_.changed();
                return;
@@ -2192,6 +2197,7 @@ void BufferView::draw(frontend::Painter & pain)
        if (height_ == 0 || width_ == 0)
                return;
        LYXERR(Debug::PAINTING, "\t\t*** START DRAWING ***");
+
        Text & text = buffer_.text();
        TextMetrics const & tm = d->text_metrics_[&text];
        int const y = tm.first().second->position();