]> git.lyx.org Git - features.git/blobdiff - src/TextMetrics.cpp
Fix bug #6161: Wrong cursor position in bidi text.
[features.git] / src / TextMetrics.cpp
index 2c74a8c8b6a3a991adb6362d0eeacb38f71a7018..fe7a928e144ab3857f5df95bdc6680faefb7417c 100644 (file)
@@ -1234,6 +1234,12 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit,
                return 0;
        }
 
+       // if the first character is a separator, we are in RTL
+       // text. This character will not be painted on screen
+       // and thus we should not count it and skip to the next.
+       if (par.isSeparator(bidi.vis2log(vc)))
+               ++vc;
+
        while (vc < end && tmpx <= x) {
                c = bidi.vis2log(vc);
                last_tmpx = tmpx;