commit ff9732462114b939f330f88689ba36d61fde3b8f
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Thu Apr 6 15:05:19 2017 +0200
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
(cherry picked from commit e3d252cd6256b32745b93c0cb0fd5170f448f91c)
---
src/TextMetrics.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index 0629c1e..68fcb3c 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -1181,8 +1181,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;
}