]> git.lyx.org Git - features.git/commitdiff
move some coords to absolute
authorAlfredo Braunstein <abraunst@lyx.org>
Mon, 16 Feb 2004 17:26:09 +0000 (17:26 +0000)
committerAlfredo Braunstein <abraunst@lyx.org>
Mon, 16 Feb 2004 17:26:09 +0000 (17:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8438 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/insets/insetcollapsable.C
src/text2.C
src/text3.C

index 679fdf9c92d10546dd765508e9996ca49aa3b5d3..36b96450c42ebd898d35d356b7e81458a7c5344f 100644 (file)
@@ -1,3 +1,10 @@
+2004-02-16  Alfredo Braunstein  <abraunst@lyx.org>
+
+       * text2.C (setCursorFromCoordinates): switch to absolute coords
+       (cursorUp): adjust
+       (cursorDown): adjust
+       * text3.C (dispatch): adjust
+
 2004-02-16  André Pönitz  <poenitz@gmx.net>
 
        * cursor.[Ch]: use new '_void_ dispatch(...)' signature (see
index dc5dd625817f1e11b3cb17024ce067fbd793bde4..a294be672b0f25d5d40d789931d2aef07532718e 100644 (file)
@@ -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);
 }
 
index 5140ddb4495b813a3ed209f991b702a7c43d649f..6000d2f04277c7222747428c2970a0029543f5ee 100644 (file)
@@ -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);
index 79641090e638f0a170a502a2e285b0e34c570bf7..6ae3f541c6604fa921ace6fa8c3e500f68d7265f 100644 (file)
@@ -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());