From: Jean-Marc Lasgouttes Date: Thu, 6 Apr 2017 13:05:19 +0000 (+0200) Subject: Set boundary correctly in getPosNearX X-Git-Tag: 2.3.0alpha1~112 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e3d252cd6256b32745b93c0cb0fd5170f448f91c;p=features.git Set boundary correctly in getPosNearX 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 --- diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 3dd052059b..843ad7762d 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -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; }