From e3d252cd6256b32745b93c0cb0fd5170f448f91c Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 6 Apr 2017 15:05:19 +0200 Subject: [PATCH] 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 --- src/TextMetrics.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; } -- 2.39.2