if (o->cur.ellipsis == ellipsis) return;
evas_object_async_block(obj);
+ o->prev.ellipsis = o->cur.ellipsis;
o->cur.ellipsis = ellipsis;
o->changed = 1;
if (o->has_filter)
Evas_Text_Data *o = obj->private_data;
/* alloc obj private data */
- o->cur.ellipsis = -1.0;
+ o->prev.ellipsis = o->cur.ellipsis = -1.0;
o->prev = o->cur;
#ifdef BIDI_SUPPORT
o->bidi_par_props = evas_bidi_paragraph_props_new();
#endif
/* If object size changed and ellipsis is set */
- if (((o->cur.ellipsis >= 0.0 ||
- o->cur.ellipsis != o->prev.ellipsis) &&
+ if (((o->cur.ellipsis >= 0.0) &&
((obj->cur->geometry.w != o->last_computed.w) ||
(obj->cur->geometry.h != o->last_computed.h))) ||
+ (o->cur.ellipsis != o->prev.ellipsis) ||
(obj->cur->scale != obj->prev->scale) ||
(o->changed_paragraph_direction))
{
#include <stdio.h>
+#include <Ecore_Evas.h>
+
#include "evas_suite.h"
#include "Evas.h"
#include "evas_tests_helpers.h"
END_TEST
#endif
+START_TEST(evas_text_render)
+{
+ Ecore_Evas *ee = ecore_evas_buffer_new(500, 500);
+ Evas *evas = ecore_evas_get(ee);
+ Evas_Object *to;
+ const char *font = TEST_FONT_NAME;
+ Evas_Font_Size size = 14;
+ int w;
+
+ evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO);
+ to = evas_object_text_add(evas);
+ evas_object_text_font_source_set(to, TEST_FONT_SOURCE);
+ evas_object_show(to);
+
+ /* Check the changing ellipsis is updated properly. */
+ evas_object_text_font_set(to, font, size);
+ evas_object_text_text_set(to, "Dynamically changing ellipsis!");
+ evas_object_text_ellipsis_set(to, 0.0);
+ evas_object_resize(to, 50, 100);
+ w = evas_object_text_horiz_advance_get(to);
+ evas_object_text_ellipsis_set(to, -1.0);
+ evas_render(evas);
+ ck_assert_int_gt(evas_object_text_horiz_advance_get(to), w);
+
+ ecore_evas_free(ee);
+}
+END_TEST
+
void evas_test_text(TCase *tc)
{
tcase_add_test(tc, evas_text_simple);
#endif
tcase_add_test(tc, evas_text_unrelated);
+ tcase_add_test(tc, evas_text_render);
}