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
This commit is contained in:
Vincent van Ravesteijn 2009-05-15 21:24:08 +00:00
parent a8682e3f5f
commit 22e8bd3c3e

View File

@ -1403,13 +1403,16 @@ 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_)