From adcc32329128b13fda47405a896319c7c96ea85f Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 22 Apr 2014 20:18:46 -0400 Subject: [PATCH] edje: the ellipsis fuckup preservation commit. what a huge, colossal cock-up of a clusterfuck. it's a good thing nobody ever uses ellipses or edje. otherwise we'd probably get complaints about this kind of thing. --- src/bin/edje/edje_cc_handlers.c | 3 ++- src/lib/edje/edje_private.h | 2 +- src/lib/edje/edje_text.c | 24 +++++++++++++++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 829c465..fe06e46 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -949,6 +949,7 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c ed->text.align.y = FROM_DOUBLE(0.5); ed->text.id_source = -1; ed->text.id_text_source = -1; + ed->text.elipsis = -1; result = &ed->common; break; @@ -7566,7 +7567,7 @@ st_collections_group_parts_part_description_text_text_source(void) @effect Used to balance the text in a relative point from 0.0 to 1.0, this point is the last section of the string to be cut out in case of a - resize that is smaller than the text itself. The default value is 0.0. + resize that is smaller than the text itself. The default value is -1.0. @endproperty */ static void diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index 28fb179..96adb6e 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -165,7 +165,7 @@ EAPI extern int _edje_default_log_dom ; /* increment this when you add new feature to edje file format without * breaking backward compatibility. */ -#define EDJE_FILE_MINOR 5 +#define EDJE_FILE_MINOR 6 /* FIXME: * diff --git a/src/lib/edje/edje_text.c b/src/lib/edje/edje_text.c index 45e32ac..0825c16 100644 --- a/src/lib/edje/edje_text.c +++ b/src/lib/edje/edje_text.c @@ -411,7 +411,29 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep, text, font, size, sw, sh, &free_text); } - else + /* when evas ellipsis support was added in efl 1.8 and used to replace + * previous support, SOMEONE, who I shall call "cedric", borked ellipsis + * defaults. as a result, edje_cc continued using 0.0 (left-most) as its default value + * for ellipsis while evas used -1.0 (no ellipsizing). + * this was moderately okay for a time because nobody was using it or GROUP parts + * with text in them very frequently, and so nobody noticed that the mismatch was breaking + * sizing in some cases when the edje ellipsis value failed to be applied, + * which ocurred any time text.min_x was set; in this case, ellipsis would NEVER be + * correctly applied, and instead the text object would only ever get the first + * ellipsis_set(0), permanently breaking the part. + * the only way to fix this while preserving previous behavior was to bump + * the edje file minor version and then check it here to ignore "unset" ellipsis + * values from old file versions. + * the downside is that this will break old files which have text.min_x set to 0...maybe. + * it also breaks documentation since the default value for edje has "become" -1.0 in order + * to preserve the expected behavior of leaving it alone permanently except for the initial + * set to 0.0. + * + * -zmike + * 22 April 2014 + */ + else if (((ed->file->version >= 3) && (ed->file->minor >= 6)) || + params->type.text.elipsis) eo_do(ep->object, evas_obj_text_ellipsis_set(params->type.text.elipsis)); -- 2.7.4