This is a regression introduced in
548e548632333f5ef533079a7aaa54aadd20ef8d.
This is really bad, and essentially broke selection geometry for bidi
text. Very serious.
The problematic code assumed that the range comparison for the items
assumed the item marked with 1 is always logically before the item marked
with 2, which is just not true.
while (it && (it != it2))
{
- if ((it1->text_pos <= it->text_pos) && (it->text_pos <= it2->text_pos))
+ if (((it1->text_pos <= it->text_pos) && (it->text_pos <= it2->text_pos)) ||
+ ((it2->text_pos <= it->text_pos) && (it->text_pos <= it1->text_pos)))
{
max_x = it->x + it->adv;
}