]> git.lyx.org Git - features.git/commitdiff
Fix cursor position before a virtual element
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 28 Feb 2015 23:23:07 +0000 (00:23 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 1 Mar 2015 14:59:00 +0000 (15:59 +0100)
When there is a virtual element like an end-of-paragraph marker, the cursor should be on the left (in RTL text).

This problem was created by 46ee6799.

src/Row.cpp

index 9d944516843c2325e5617b4bd389e6857efcfc9a..4a2f2e58486948bd0cc8990dfd71839a5260c32a 100644 (file)
@@ -47,7 +47,8 @@ double Row::Element::pos2x(pos_type const i) const
 
        double w = 0;
        //handle first the two bounds of the element
-       if (i == endpos && !(inset && inset->lyxCode() == SEPARATOR_CODE))
+       if (i == endpos && type != VIRTUAL
+               && !(inset && inset->lyxCode() == SEPARATOR_CODE))
                w = rtl ? 0 : full_width();
        else if (i == pos || type != STRING)
                w = rtl ? full_width() : 0;