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.
This commit is contained in:
Mike Blumenkrantz 2014-04-22 20:18:46 -04:00
parent c2ced46d2d
commit adcc323291
3 changed files with 26 additions and 3 deletions

View File

@ -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

View File

@ -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:
*

View File

@ -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));