From f6600fa8cb4e3f5e68206bfb1a13e26d56c9b320 Mon Sep 17 00:00:00 2001 From: cedric Date: Thu, 7 Apr 2011 12:34:18 +0000 Subject: [PATCH] edje: prevent file format break with trunk. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@58433 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_cache.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/lib/edje_cache.c b/src/lib/edje_cache.c index b463a8a..3d1d789 100644 --- a/src/lib/edje_cache.c +++ b/src/lib/edje_cache.c @@ -76,6 +76,33 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) edc->references = 1; edc->part = ce->entry; + /* For Edje file build with Edje 1.0, people expect text.align to be 0.0 0.0 */ + if (edf->version <= 3 && edf->minor <= 1) + { + /* This will preserve previous rendering */ + unsigned int i; + + for (i = 0; i < edc->parts_count; ++i) + { + if (edc->parts[i]->type == EDJE_PART_TYPE_TEXTBLOCK) + { + Edje_Part_Description_Text *text; + unsigned int j; + + text = (Edje_Part_Description_Text*) edc->parts[i]->default_desc; + text->text.align.x = TO_DOUBLE(0.0); + text->text.align.y = TO_DOUBLE(0.0); + + for (j = 0; j < edc->parts[i]->other.desc_count; ++j) + { + text = (Edje_Part_Description_Text*) edc->parts[i]->other.desc[j]; + text->text.align.x = TO_DOUBLE(0.0); + text->text.align.y = TO_DOUBLE(0.0); + } + } + } + } + snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%i", id); data = eet_read(edf->ef, buf, &size); -- 2.7.4