]> git.lyx.org Git - features.git/commitdiff
Fix display of cursor at end of row
authorJean-Marc <lasgouttes@lyx.org>
Mon, 28 Jul 2014 20:03:57 +0000 (22:03 +0200)
committerJean-Marc <lasgouttes@lyx.org>
Mon, 28 Jul 2014 20:03:57 +0000 (22:03 +0200)
The particular case here is:
* the last element of the row is an inset
* the row is broken by a display inset.

src/Row.cpp

index cab3ab750c0f17fccc0df093bc07d65ecbf1dae3..34be0529aa944208beedf86b2741cbb9380ca4dc 100644 (file)
@@ -47,10 +47,10 @@ double Row::Element::pos2x(pos_type const i) const
 
        double w = 0;
        //handle first the two bounds of the element
-       if (i == pos || type != STRING)
-               w = rtl ? width() : 0;
-       else if (i == endpos)
+       if (i == endpos)
                w = rtl ? 0 : width();
+       else if (i == pos || type != STRING)
+               w = rtl ? width() : 0;
        else {
                FontMetrics const & fm = theFontMetrics(font);
                w = fm.pos2x(str, i - pos, font.isVisibleRightToLeft());