diff options
author | Amitesh Singh <amitesh.sh@samsung.com> | 2015-12-03 11:26:10 +0530 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2015-12-03 11:31:07 -0500 |
commit | 9c6ea9d70f26754a76e8b469ea4977363a47a993 (patch) | |
tree | cfd750aaaf5f880ae21b49d7402794f658f6fdf1 | |
parent | 33af9c02101e45a13114a1a79ac7195a8758a8bd (diff) | |
download | efl-9c6ea9d70f26754a76e8b469ea4977363a47a993.tar.gz |
edje: fix edje RTL description in case of custom state of a part
Summary:
In case of RTL, the "custom" state properties does not apply. It happened because we don't copy the latest src to
dst in set_state(PART:.., "custom", 0.0); in case of dst is already populated.
We should copy the updated src to dst whenever we set the new custom description.
@fix
Reviewers: cedric, raster, jpeg, zmike, jaehwan
Subscribers: kimcinoo, seoz, jpeg
Differential Revision: https://phab.enlightenment.org/D3394
-rw-r--r-- | src/lib/edje/edje_calc.c | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 763c67b3a6..3eae7e0af3 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -271,6 +271,52 @@ _edje_part_make_rtl(Edje_Part_Description_Common *desc) desc->rel2.id_x = i; } +static Edje_Part_Description_Common * +_edje_get_custom_description_by_orientation(Edje *ed, Edje_Part_Description_Common *src, Edje_Part_Description_Common **dst, unsigned char type) +{ + Edje_Part_Description_Common *ret; + size_t memsize = 0; + + if (!(*dst)) + { + ret = _edje_get_description_by_orientation(ed, src, dst, type); + return ret; + } + +#define POPULATE_MEMSIZE_RTL(Short, Type) \ +case EDJE_PART_TYPE_##Short: \ +{ \ + memsize = sizeof(Edje_Part_Description_##Type); \ + break; \ +} + + switch (type) + { + POPULATE_MEMSIZE_RTL(RECTANGLE, Common); + POPULATE_MEMSIZE_RTL(SNAPSHOT, Snapshot); + POPULATE_MEMSIZE_RTL(SWALLOW, Common); + POPULATE_MEMSIZE_RTL(GROUP, Common); + POPULATE_MEMSIZE_RTL(SPACER, Common); + POPULATE_MEMSIZE_RTL(TEXT, Text); + POPULATE_MEMSIZE_RTL(TEXTBLOCK, Text); + POPULATE_MEMSIZE_RTL(IMAGE, Image); + POPULATE_MEMSIZE_RTL(PROXY, Proxy); + POPULATE_MEMSIZE_RTL(BOX, Box); + POPULATE_MEMSIZE_RTL(TABLE, Table); + POPULATE_MEMSIZE_RTL(EXTERNAL, External); + POPULATE_MEMSIZE_RTL(CAMERA, Camera); + POPULATE_MEMSIZE_RTL(LIGHT, Light); + POPULATE_MEMSIZE_RTL(MESH_NODE, Mesh_Node); + } +#undef POPULATE_MEMSIZE_RTL + + ret = *dst; + memcpy(ret, src, memsize); + _edje_part_make_rtl(ret); + + return ret; +} + /** * Returns part description * @@ -398,8 +444,8 @@ _edje_part_description_find(Edje *ed, Edje_Real_Part *rp, const char *state_name if (!strcmp(state_name, "custom")) return rp->custom ? - _edje_get_description_by_orientation(ed, rp->custom->description, - &rp->custom->description_rtl, ep->type) : NULL; + _edje_get_custom_description_by_orientation(ed, rp->custom->description, + &rp->custom->description_rtl, ep->type) : NULL; if (!strcmp(state_name, "default") && approximate) { |