Evas textblock: Fixed a couple of cases where a geometry of a visible format item would have been returned although it shouldn't have.
SVN revision: 56420
This commit is contained in:
parent
81616cec5d
commit
4aaa8df5fe
|
@ -7193,65 +7193,58 @@ _evas_textblock_cursor_range_in_line_geometry_get(
|
||||||
/* IMPORTANT: Don't use cur1/cur2 past this point (because of bidi),
|
/* IMPORTANT: Don't use cur1/cur2 past this point (because of bidi),
|
||||||
* unless you are know what you are doing */
|
* unless you are know what you are doing */
|
||||||
|
|
||||||
/* Special case when they share the same item. */
|
/* Special case when they share the same item and it's a text item */
|
||||||
if (it1 == it2)
|
if ((it1 == it2) && (it1->type == EVAS_TEXTBLOCK_ITEM_TEXT))
|
||||||
{
|
{
|
||||||
Evas_Coord x1, w1, x2, w2;
|
Evas_Coord x1, w1, x2, w2;
|
||||||
Evas_Coord x, w, y, h;
|
Evas_Coord x, w, y, h;
|
||||||
if (it1->type == EVAS_TEXTBLOCK_ITEM_TEXT)
|
Evas_Object_Textblock_Text_Item *ti;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ti = _ITEM_TEXT(it1);
|
||||||
|
ret = cur->ENFN->font_char_coords_get(cur->ENDT,
|
||||||
|
ti->format->font.font,
|
||||||
|
ti->text, &ti->bidi_props,
|
||||||
|
start,
|
||||||
|
&x1, &y, &w1, &h);
|
||||||
|
if (!ret)
|
||||||
{
|
{
|
||||||
Evas_Object_Textblock_Text_Item *ti;
|
return NULL;
|
||||||
int ret;
|
}
|
||||||
ti = _ITEM_TEXT(it1);
|
ret = cur->ENFN->font_char_coords_get(cur->ENDT,
|
||||||
ret = cur->ENFN->font_char_coords_get(cur->ENDT,
|
ti->format->font.font,
|
||||||
ti->format->font.font,
|
ti->text, &ti->bidi_props,
|
||||||
ti->text, &ti->bidi_props,
|
end,
|
||||||
start,
|
&x2, &y, &w2, &h);
|
||||||
&x1, &y, &w1, &h);
|
if (!ret)
|
||||||
if (!ret)
|
{
|
||||||
{
|
return NULL;
|
||||||
return NULL;
|
}
|
||||||
}
|
|
||||||
ret = cur->ENFN->font_char_coords_get(cur->ENDT,
|
|
||||||
ti->format->font.font,
|
|
||||||
ti->text, &ti->bidi_props,
|
|
||||||
end,
|
|
||||||
&x2, &y, &w2, &h);
|
|
||||||
if (!ret)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Make x2 the one on the right */
|
/* Make x2 the one on the right */
|
||||||
if (x2 < x1)
|
if (x2 < x1)
|
||||||
{
|
{
|
||||||
Evas_Coord tmp;
|
Evas_Coord tmp;
|
||||||
tmp = x1;
|
tmp = x1;
|
||||||
x1 = x2;
|
x1 = x2;
|
||||||
x2 = tmp;
|
x2 = tmp;
|
||||||
|
|
||||||
tmp = w1;
|
tmp = w1;
|
||||||
w1 = w2;
|
w1 = w2;
|
||||||
w2 = tmp;
|
w2 = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
#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 = x1 + w1;
|
x = x1 + w1;
|
||||||
w = x2 + w2 - x;
|
w = x2 + w2 - x;
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
x = x1;
|
|
||||||
w = x2 - x1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
x = 0;
|
x = x1;
|
||||||
w = it1->w;
|
w = x2 - x1;
|
||||||
}
|
}
|
||||||
if (w > 0)
|
if (w > 0)
|
||||||
{
|
{
|
||||||
|
@ -7263,7 +7256,7 @@ _evas_textblock_cursor_range_in_line_geometry_get(
|
||||||
tr->w = w;
|
tr->w = w;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (it1 != it2)
|
||||||
{
|
{
|
||||||
/* Get the middle items */
|
/* Get the middle items */
|
||||||
Evas_Coord min_x, max_x;
|
Evas_Coord min_x, max_x;
|
||||||
|
@ -7348,8 +7341,17 @@ _evas_textblock_cursor_range_in_line_geometry_get(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* FIXME: This should be here for rtl, items, this can't be achieved
|
||||||
|
* yet, there are stuff to do before. ask Tom (TAsn) what's needed
|
||||||
|
* to be done in order to get that right to rtl as well if you
|
||||||
|
* are interested. - If you see this message please let me Tom (TAsn)
|
||||||
|
* know, because I should have fixed it immediately. */
|
||||||
|
#if 0
|
||||||
x = 0;
|
x = 0;
|
||||||
w = it2->w;
|
w = it2->w;
|
||||||
|
#else
|
||||||
|
w = 0; /* Disable this item for the moment */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (w > 0)
|
if (w > 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue