From 6ac158896b7a49e045be870ab0e0f054a0ab2da2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 22 Aug 2002 15:27:51 +0000 Subject: [PATCH] try to correct x position where curosr drops of inset. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5075 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_cursor.C | 12 +++++++++++- src/mathed/math_cursor.h | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 17d7d16c32..6a371a2a9b 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -670,12 +670,22 @@ void MathCursor::handleNest(MathAtom const & a) } -void MathCursor::getPos(int & x, int & y) +void MathCursor::getPos(int & x, int & y) const { par()->getPos(idx(), pos(), x, y); } +int MathCursor::targetX() const +{ + if (targetx_ != -1) + return targetx_; + int x = 0, y = 0; + getPos(x, y); + return x; +} + + MathInset * MathCursor::par() const { return cursor().par_; diff --git a/src/mathed/math_cursor.h b/src/mathed/math_cursor.h index bd2da28ad7..74903c75c0 100644 --- a/src/mathed/math_cursor.h +++ b/src/mathed/math_cursor.h @@ -102,7 +102,9 @@ public: /// in pixels from top of screen void setPos(int x, int y); /// in pixels from top of screen - void getPos(int & x, int & y); + void getPos(int & x, int & y) const; + /// in pixels from left of screen + int targetX() const; /// current inset MathInset * par() const; /// return the next enclosing grid inset and the cursor's index in it -- 2.39.2