From bc3029bcf470d4a98e22ee7603bdef0dcf78333a Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 16 Jan 2008 14:31:00 +0000 Subject: [PATCH] scrolling tweaks... asymptotically tending towards scrolling correctness... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22599 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index f245fbabf0..a7b5e77af5 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -449,14 +449,13 @@ void BufferView::updateScrollbar() // Build temporary cursor. Cursor cur(*this); cur.push(buffer_.inset()); - /*Inset * inset =*/ tm.editXY(cur, width_ / 4, 10); + /*Inset * inset =*/ tm.editXY(cur, 0, 10); pit_type const first_visible_pit = cur.bottom().pit(); d->scrollbarParameters_.position = coordOffset(cur, cur.boundary()).y_; - // FIXME: The screen position (width_/4, 10) works reasonably well - // for most texts but in some cases the first visible cursor position is - // hard to find when the screen begins with a Label for example. So in the - // case where coordOffset() returns (0,0), we should try with another - // position and/or look at the returned Inset geometry. + d->scrollbarParameters_.position -= + tm.parMetrics(first_visible_pit).position(); + // FIXME: The screen position (0, 10) works reasonably well for most texts + // but the top and bottom positions are still not quite correct. LYXERR(Debug::SCROLLING, "first visible pit : " << first_visible_pit); LYXERR(Debug::SCROLLING, "offset from top : " << d->scrollbarParameters_.position); -- 2.39.5