From 22e8bd3c3e6b7c8c869359228fc7b519f2addbef Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Fri, 15 May 2009 21:24:08 +0000 Subject: [PATCH] Partial fix for bug #5465. This will enable scrolling down past a very large inset. With this code, LyX will scroll up everytime you try to scroll past the inset, because the cursor is set on the uppermost row. see: http://thread.gmane.org/gmane.editors.lyx.devel/118449 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29683 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 1ebd991101..b932332a3a 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -1403,14 +1403,17 @@ bool BufferView::dispatch(FuncRequest const & cmd) case LFUN_SCREEN_UP: case LFUN_SCREEN_DOWN: { Point p = getPos(cur, cur.boundary()); - if (p.y_ < 0 || p.y_ > height_) { + // This code has been commented out to enable to scroll down a + // document, even if there are large insets in it (see bug #5465). + /*if (p.y_ < 0 || p.y_ > height_) { // The cursor is off-screen so recenter before proceeding. showCursor(); p = getPos(cur, cur.boundary()); - } + }*/ int const scrolled = scroll(cmd.action == LFUN_SCREEN_UP ? - height_ : height_); if (cmd.action == LFUN_SCREEN_UP && scrolled > - height_) + if (cmd.action == LFUN_SCREEN_UP && scrolled > -height_) p = Point(0, 0); if (cmd.action == LFUN_SCREEN_DOWN && scrolled < height_) p = Point(width_, height_);