From 3d0d1e5a82afd0a5047a2611eb393f354ee75344 Mon Sep 17 00:00:00 2001 From: Alfredo Braunstein Date: Mon, 16 Feb 2004 17:26:09 +0000 Subject: [PATCH] move some coords to absolute git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8438 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 7 +++++++ src/insets/insetcollapsable.C | 5 ----- src/text2.C | 8 +++++--- src/text3.C | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 679fdf9c92..36b96450c4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2004-02-16 Alfredo Braunstein + + * text2.C (setCursorFromCoordinates): switch to absolute coords + (cursorUp): adjust + (cursorDown): adjust + * text3.C (dispatch): adjust + 2004-02-16 André Pönitz * cursor.[Ch]: use new '_void_ dispatch(...)' signature (see diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index dc5dd62581..a294be672b 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -311,11 +311,6 @@ InsetBase * InsetCollapsable::editXY(LCursor & cur, int x, int y) //inset yet. I personally think it's ok. (ab) return this; } - -//if (y <= yo() + inset.ascent() + button_dim.y2) -// y = yo(); -//else -// y += inset.ascent() - height_collapsed(); return inset.editXY(cur, x, y); } diff --git a/src/text2.C b/src/text2.C index 5140ddb449..6000d2f042 100644 --- a/src/text2.C +++ b/src/text2.C @@ -1293,9 +1293,11 @@ pos_type LyXText::getColumnNearX(ParagraphList::iterator pit, } -// x,y are coordinates relative to this LyXText +// x,y are absolute coordinates void LyXText::setCursorFromCoordinates(LCursor & cur, int x, int y) { + x -= xo_; + y -= yo_; CursorSlice old_cursor = cur.current(); ParagraphList::iterator pit; Row const & row = *getRowNearY(y, pit); @@ -1468,7 +1470,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(cur, x - xo_, y - yo_); + setCursorFromCoordinates(cur, x, y); if (!selecting) { InsetBase * inset_hit = checkInsetHit(cur.x_target(), y); @@ -1483,7 +1485,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, x - xo_, y - yo_); + setCursorFromCoordinates(cur, x, y); if (!selecting) { InsetBase * inset_hit = checkInsetHit(cur.x_target(), y); diff --git a/src/text3.C b/src/text3.C index 79641090e6..6ae3f541c6 100644 --- a/src/text3.C +++ b/src/text3.C @@ -1147,7 +1147,7 @@ DispatchResult LyXText::dispatch(LCursor & cur, FuncRequest const & cmd) // Clear the selection cur.clearSelection(); - setCursorFromCoordinates(cur, cmd.x - xo_, cmd.y - yo_); + setCursorFromCoordinates(cur, cmd.x, cmd.y); cur.resetAnchor(); finishUndo(); cur.x_target() = cursorX(cur.current()); -- 2.39.5