forked from enlightenment/efl
Evas textblock: Fixed range geometry get in some cases involving rtl.
SVN revision: 56416
This commit is contained in:
parent
9f36a734b2
commit
06957098c6
|
@ -7165,17 +7165,30 @@ _evas_textblock_cursor_range_in_line_geometry_get(
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This also takes bidi into account because of the positions
|
/* Make x2 the one on the right */
|
||||||
* in the text are taken into account */
|
if (x2 < x1)
|
||||||
if (x2 > x1)
|
|
||||||
{
|
{
|
||||||
w = x2 - x1;
|
Evas_Coord tmp;
|
||||||
x = x1;
|
tmp = x1;
|
||||||
|
x1 = x2;
|
||||||
|
x2 = tmp;
|
||||||
|
|
||||||
|
tmp = w1;
|
||||||
|
w1 = w2;
|
||||||
|
w2 = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef BIDI_SUPPORT
|
||||||
|
if (evas_bidi_is_rtl_char(&ti->bidi_props, 0))
|
||||||
|
{
|
||||||
|
x = x1 + w1;
|
||||||
|
w = x2 + w2 - x;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
w = x1 - x2;
|
x = x1;
|
||||||
x = x2;
|
w = x2 - x1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -7223,7 +7236,7 @@ _evas_textblock_cursor_range_in_line_geometry_get(
|
||||||
#ifdef BIDI_SUPPORT
|
#ifdef BIDI_SUPPORT
|
||||||
if (evas_bidi_is_rtl_char(&ti->bidi_props, 0))
|
if (evas_bidi_is_rtl_char(&ti->bidi_props, 0))
|
||||||
{
|
{
|
||||||
w = x;
|
w = x + w;
|
||||||
x = 0;
|
x = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -7284,6 +7297,7 @@ _evas_textblock_cursor_range_in_line_geometry_get(
|
||||||
#ifdef BIDI_SUPPORT
|
#ifdef BIDI_SUPPORT
|
||||||
if (evas_bidi_is_rtl_char(&ti->bidi_props, 0))
|
if (evas_bidi_is_rtl_char(&ti->bidi_props, 0))
|
||||||
{
|
{
|
||||||
|
x += w;
|
||||||
w = it2->w - x;
|
w = it2->w - x;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue