From b8be6be26885a205606144785e8e10802edfd318 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 21 Dec 2007 10:11:32 +0000 Subject: [PATCH] Fix LFUN_BUFFER_END git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22226 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 1ccc1c3c9d..31486b3ab9 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -424,7 +424,7 @@ void BufferView::updateScrollbar() << " curr par: " << d->cursor_.bottom().pit() << " default height " << defaultRowHeight()); - int const parsize = int(t.paragraphs().size() - 1); + int const parsize = int(t.paragraphs().size()); if (d->par_height_.size() != parsize) { d->par_height_.clear(); // FIXME: We assume a default paragraph height of 4 rows. This @@ -695,12 +695,13 @@ void BufferView::showCursor() int offset = coordOffset(d->cursor_, d->cursor_.boundary()).y_; d->anchor_pit_ = bot_pit; + Dimension const & row_dim = d->cursor_.textRow().dimension(); if (d->anchor_pit_ == 0) d->anchor_ypos_ = offset + pm.ascent(); else if (d->anchor_pit_ >= pos_type(bot.text()->paragraphs().size() - 1)) { d->anchor_pit_ = bot.text()->paragraphs().size() - 1; - d->anchor_ypos_ = offset + pm.height() - height_; + d->anchor_ypos_ = height_ - offset - row_dim.descent(); } else { d->anchor_ypos_ = offset + pm.ascent() - height_ / 2; } -- 2.39.2