i++)
;
right_bound = i;
- if (left_bound < 0)
- left_bound = 0;
- if (right_bound >= (int) (props->start + props->len))
- right_bound = props->start + props->len - 1;
if (right_bound == left_bound)
{
{
if (left_bound < 0)
{
- items = props->start + props->len -
- props->info->ot[left_bound + 1].source_cluster;
+ items = props->text_offset + props->text_len - base_cluster;
}
else
{
- items = props->info->ot[left_bound].source_cluster -
- props->info->ot[left_bound + 1].source_cluster;
+ items = props->info->ot[left_bound].source_cluster - base_cluster;
}
}
else
{
- if (right_bound == (int) (props->start + props->len))
+ if (right_bound > (int) (props->text_offset + props->text_len))
{
- items = props->start + props->len -
- props->info->ot[right_bound - 1].source_cluster;
+ items = props->text_offset + props->text_len - base_cluster;
}
else
{
- items = props->info->ot[right_bound].source_cluster -
- props->info->ot[right_bound - 1].source_cluster;
+ items = props->info->ot[right_bound].source_cluster - base_cluster;
}
}
return (items > 0) ? items : 1;
position = pos;
/* If it's the null, choose location according to the direction. */
- if (text_props->len == position)
+ if (position == text_props->text_len)
{
/* if it's rtl then the location is the left of the string,
* otherwise, the right. */
position = pos;
/* If it's the null, choose location according to the direction. */
- if (text_props->len == position)
+ if (position == text_props->text_len)
{
/* if it's rtl then the location is the left of the string,
* otherwise, the right. */
ext->text_offset = base->text_offset + base->len;
#endif
}
+ ext->text_len = base->text_len - (ext->text_offset - base->text_offset);
+ base->text_len = (ext->text_offset - base->text_offset);
}
/* Won't work in the middle of ligatures */
}
item1->len += item2->len;
+ item1->text_len += item2->text_len;
}
EAPI Eina_Bool
}
text_props->len = len;
#endif
+ text_props->text_len = len;
text_props->info->refcount = 1;
return EINA_TRUE;
}
size_t start;
size_t len;
size_t text_offset; /* The text offset from the start of the info */
+ size_t text_len; /* The length of the original text */
Evas_BiDi_Props bidi;
Evas_Script_Type script;
Evas_Text_Props_Info *info;