]> git.lyx.org Git - features.git/commitdiff
scrolling tweaks...
authorAbdelrazak Younes <younes@lyx.org>
Wed, 16 Jan 2008 15:15:26 +0000 (15:15 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 16 Jan 2008 15:15:26 +0000 (15:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22600 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp

index a7b5e77af54de096ac1531abe46a61d6beb0521c..6778a03dc622a145f4e3deb5f0897a53edb66189 100644 (file)
@@ -452,10 +452,11 @@ void BufferView::updateScrollbar()
        /*Inset * inset =*/ tm.editXY(cur, 0, 10);
        pit_type const first_visible_pit = cur.bottom().pit();
        d->scrollbarParameters_.position = coordOffset(cur, cur.boundary()).y_;
-       d->scrollbarParameters_.position -=
-               tm.parMetrics(first_visible_pit).position();
+       ParagraphMetrics const & visible_pm = tm.parMetrics(first_visible_pit);
+       d->scrollbarParameters_.position -= visible_pm.position();
+       d->scrollbarParameters_.position += visible_pm.ascent();
        // FIXME: The screen position (0, 10) works reasonably well for most texts
-       // but the top and bottom positions are still not quite correct.
+       // but the bottom position is still not correct.
        LYXERR(Debug::SCROLLING, "first visible pit : " << first_visible_pit);
        LYXERR(Debug::SCROLLING, "offset from top : "
                << d->scrollbarParameters_.position);