git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28397 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-02-08 12:35:14 +00:00
parent 1fe1080cf6
commit 24cd681863

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