forked from enlightenment/efl
evas: reduce number of relayout of text object to the strict minimum.
This commit is contained in:
parent
3b8b2ac66c
commit
2e5a0215e6
|
@ -45,6 +45,7 @@ struct _Evas_Object_Text
|
|||
Evas_Object_Text_Item *ellipsis_start;
|
||||
Evas_Object_Text_Item *ellipsis_end;
|
||||
Evas_Coord w, h;
|
||||
int advance;
|
||||
} last_computed;
|
||||
|
||||
Evas_BiDi_Paragraph_Props *bidi_par_props;
|
||||
|
@ -707,8 +708,7 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Object_Text *o, Eina_Unicode
|
|||
!memcmp(&o->cur, &o->prev, sizeof (o->cur)) &&
|
||||
o->cur.text == text &&
|
||||
obj->cur->scale == obj->prev->scale &&
|
||||
o->last_computed.w == obj->cur->geometry.w &&
|
||||
o->last_computed.h == obj->cur->geometry.h)
|
||||
o->last_computed.advance <= obj->cur->geometry.w)
|
||||
return;
|
||||
|
||||
evas_object_content_change(eo_obj, obj);
|
||||
|
@ -905,6 +905,7 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Object_Text *o, Eina_Unicode
|
|||
if (o->cur.text != text) free(o->cur.text);
|
||||
o->cur.text = text;
|
||||
o->prev = o->cur;
|
||||
o->last_computed.advance = advance;
|
||||
|
||||
_evas_object_text_item_order(eo_obj, o);
|
||||
|
||||
|
|
Loading…
Reference in New Issue