From 83f68485eedc12f2093cc77e2c36a36bbfe5d3af Mon Sep 17 00:00:00 2001 From: Alfredo Braunstein Date: Fri, 13 Feb 2004 09:43:02 +0000 Subject: [PATCH] two bits for cursor navigation inside insets git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8428 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/text2.C | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ede0327d78..e822b80ea1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-02-13 Alfredo Braunstein + + * text2.C (cursorUp, cursorDown): fix coords + (moveUp): fix crash 2004-02-12 André Pönitz diff --git a/src/text2.C b/src/text2.C index 7837ee7831..4269ec2cfb 100644 --- a/src/text2.C +++ b/src/text2.C @@ -1400,7 +1400,7 @@ DispatchResult LyXText::moveLeftIntern(LCursor & cur, DispatchResult LyXText::moveUp(LCursor & cur) { - if (cur.par() == 0 && cur.row() == 0) + if (cur.par() == 0 && cur.crow() == 0) return DispatchResult(false, FINISHED_UP); cursorUp(cur, false); cur.clearSelection(); @@ -1468,7 +1468,7 @@ void LyXText::cursorUp(LCursor & cur, bool selecting) Row const & row = cur.textRow(); int x = cur.x_target(); int y = cursorY(cur.current()) - row.baseline() - 1; - setCursorFromCoordinates(x, y); + setCursorFromCoordinates(cur.current(), x - xo_, y - yo_); if (!selecting) { InsetBase * inset_hit = checkInsetHit(cur.x_target(), y); @@ -1483,7 +1483,7 @@ void LyXText::cursorDown(LCursor & cur, bool selecting) Row const & row = cur.textRow(); int x = cur.x_target(); int y = cursorY(cur.current()) - row.baseline() + row.height() + 1; - setCursorFromCoordinates(cur.current(), x, y); + setCursorFromCoordinates(cur.current(), x - xo_, y - yo_); if (!selecting) { InsetBase * inset_hit = checkInsetHit(cur.x_target(), y); -- 2.39.2