]> git.lyx.org Git - features.git/commitdiff
Fix bug 5573. http://bugzilla.lyx.org/show_bug.cgi?id=5573.
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 8 Feb 2009 12:35:14 +0000 (12:35 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 8 Feb 2009 12:35:14 +0000 (12:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28397 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp

index 42ad5963206b1b10ae37cb67cd89b2c05d4154ca..4982e2dc2004013992ab10a068aad31dc60922a8 100644 (file)
@@ -819,7 +819,8 @@ void BufferView::showCursor(DocIterator const & dit)
                if (ypos - row_dim.ascent() < 0)
                        scrolled = scrollUp(- ypos + row_dim.ascent());
                else if (ypos + row_dim.descent() > height_)
-                       scrolled = scrollDown(ypos - height_ + row_dim.descent());
+                       scrolled = scrollDown(ypos - defaultRowHeight());
+
                // else, nothing to do, the cursor is already visible so we just return.
                if (scrolled != 0) {
                        updateMetrics();
@@ -845,8 +846,10 @@ void BufferView::showCursor(DocIterator const & dit)
                d->anchor_ypos_ = offset + pm.ascent();
        else if (d->anchor_pit_ == max_pit)
                d->anchor_ypos_ = height_ - offset - row_dim.descent();
+       else if (offset > height_)
+               d->anchor_ypos_ = height_ - offset - defaultRowHeight();
        else
-               d->anchor_ypos_ = defaultRowHeight() * 2 - offset - row_dim.descent();
+               d->anchor_ypos_ = defaultRowHeight() * 2;
 
        updateMetrics();
        buffer_.changed();