]> git.lyx.org Git - lyx.git/commitdiff
Fix to 2249 (cursor mathed positioning)
authorMartin Vermeer <martin.vermeer@hut.fi>
Fri, 3 Feb 2006 17:31:19 +0000 (17:31 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Fri, 3 Feb 2006 17:31:19 +0000 (17:31 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10806 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/cursor.C

index 5c1dcb898896b7e04f754c316baf0048f5c766bb..b069f4e5e85a974edadb047ed3b926fdf102b5b2 100644 (file)
@@ -1,3 +1,8 @@
+2006-02-03  Martin Vermeer  <martin.vermeer@hut.fi>
+
+       * cursor.C (bruteFind2): convert relative to absolute co-ordinates
+       for correct in-mathed positioning
+
 2006-02-03  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * rowpainter.C (paintForeignMark): fix foreign blue line under
index de6463b518eb7b826d9b894eaaaec5f68ef98498..a489b26b51e69046fb168f47c5e093210a0f55d9 100644 (file)
@@ -97,7 +97,12 @@ namespace {
                for (size_t i = 0; ; ++i) {
                        int xo;
                        int yo;
-                       it.inset().cursorPos(it.top(), c.boundary() && ((i+1) == it.depth()), xo, yo);
+                       InsetBase const * inset = &it.inset();
+                       Point o = theCoords.getInsets().xy(inset);
+                       inset->cursorPos(it.top(), c.boundary(), xo, yo);
+                       // Convert to absolute
+                       xo += o.x_;
+                       yo += o.y_;
                        double d = (x - xo) * (x - xo) + (y - yo) * (y - yo);
                        // '<=' in order to take the last possible position
                        // this is important for clicking behind \sum in e.g. '\sum_i a'