From 09ae774b498a1563d8927fe3cedbf7468beb8d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Sun, 2 Dec 2001 23:20:56 +0000 Subject: [PATCH] =?UTF-8?q?2001-12-03=20=20Lars=20Gullik=20Bj=EF=BF=BDnnes?= =?UTF-8?q?=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * screen.C (topCursorVisible): scroll half a page when the cursor reached top of bottom of screen git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3135 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/screen.C | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0915ce0676..51cad52209 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-12-03 Lars Gullik Bjønnes + + * screen.C (topCursorVisible): scroll half a page when the cursor + reached top of bottom of screen + 2001-12-02 Lars Gullik Bjønnes * vspace.[Ch] (operator!=): add operator. diff --git a/src/screen.C b/src/screen.C index c9590cf578..e6a014af8f 100644 --- a/src/screen.C +++ b/src/screen.C @@ -393,21 +393,25 @@ unsigned int LyXScreen::topCursorVisible(LyXText const * text) + text->cursor.row()->height() - text->first >= owner.height()) { if (text->cursor.row()->height() < owner.height() - && text->cursor.row()->height() > owner.height() / 4) + && text->cursor.row()->height() > owner.height() / 4) { newtop = text->cursor.y() + text->cursor.row()->height() - text->cursor.row()->baseline() - owner.height(); - else + } else { + // scroll down newtop = text->cursor.y() - - 3 * owner.height() / 4; /* the scroll region must be so big!! */ + - owner.height() / 2; /* the scroll region must be so big!! */ + } + } else if (static_cast((text->cursor.y()) - text->cursor.row()->baseline()) < text->first && text->first > 0) { if (text->cursor.row()->height() < owner.height() - && text->cursor.row()->height() > owner.height() / 4) + && text->cursor.row()->height() > owner.height() / 4) { newtop = text->cursor.y() - text->cursor.row()->baseline(); - else { - newtop = text->cursor.y() - owner.height() / 4; + } else { + // scroll up + newtop = text->cursor.y() - owner.height() / 2; newtop = min(newtop, int(text->first)); } }