]> git.lyx.org Git - features.git/commitdiff
Set boundary correctly in getPosNearX
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 6 Apr 2017 13:05:19 +0000 (15:05 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 6 Apr 2017 13:16:59 +0000 (15:16 +0200)
The code that looks whether neighbor block has a different direction
should look to the left or to the right depending on the direction of
the current block.

Fixes part of bug #10569

src/TextMetrics.cpp

index 3dd052059b44e39d86c07b5eaba743f2631ed59e..843ad7762ded41079ae0150ace17cfcb26425261 100644 (file)
@@ -1140,8 +1140,10 @@ pos_type TextMetrics::getPosNearX(Row const & row, int & x,
                 * how boundary helps here.
                 */
                else if (pos == cit->endpos
-                        && cit + 1 != row.end()
-                        && cit->isRTL() != (cit + 1)->isRTL())
+                        && ((!cit->isRTL() && cit + 1 != row.end()
+                             && (cit + 1)->isRTL())
+                            || (cit->isRTL() && cit != row.begin()
+                                && !(cit - 1)->isRTL())))
                        boundary = true;
        }