From daec1b2a810aab9d88113182e13937f2054ac060 Mon Sep 17 00:00:00 2001 From: tsauerbeck Date: Sat, 30 Oct 2004 14:19:46 +0000 Subject: [PATCH] simplified _edje_part_description_apply(). one code block was executed twice for no reason apparently. removed some condition checks that aren't needed. SVN revision: 12087 --- legacy/edje/src/lib/edje_calc.c | 56 +++++++++++---------------------- 1 file changed, 18 insertions(+), 38 deletions(-) diff --git a/legacy/edje/src/lib/edje_calc.c b/legacy/edje/src/lib/edje_calc.c index f1bd841465..5b1ea3092f 100644 --- a/legacy/edje/src/lib/edje_calc.c +++ b/legacy/edje/src/lib/edje_calc.c @@ -95,45 +95,25 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, char *d1, double v1, ep->param1.description = _edje_part_description_find(ed, ep, d1, v1); if (!ep->param1.description) - ep->param1.description = ep->part->default_desc; + ep->param1.description = ep->part->default_desc; /* never NULL */ ep->param2.description = _edje_part_description_find(ed, ep, d2, v2); - ep->param1.rel1_to_x = NULL; - ep->param1.rel1_to_y = NULL; - ep->param1.rel2_to_x = NULL; - ep->param1.rel2_to_y = NULL; - if (ep->param1.description) - { - if (ep->param1.description->rel1.id_x >= 0) - ep->param1.rel1_to_x = ed->table_parts[ep->param1.description->rel1.id_x % ed->table_parts_size]; - if (ep->param1.description->rel1.id_y >= 0) - ep->param1.rel1_to_y = ed->table_parts[ep->param1.description->rel1.id_y % ed->table_parts_size]; - if (ep->param1.description->rel2.id_x >= 0) - ep->param1.rel2_to_x = ed->table_parts[ep->param1.description->rel2.id_x % ed->table_parts_size]; - if (ep->param1.description->rel2.id_y >= 0) - ep->param1.rel2_to_y = ed->table_parts[ep->param1.description->rel2.id_y % ed->table_parts_size]; - } - - ep->param1.rel1_to_x = NULL; - ep->param1.rel1_to_y = NULL; - ep->param1.rel2_to_x = NULL; - ep->param1.rel2_to_y = NULL; - if (ep->param1.description) - { - if (ep->param1.description->rel1.id_x >= 0) - ep->param1.rel1_to_x = ed->table_parts[ep->param1.description->rel1.id_x % ed->table_parts_size]; - if (ep->param1.description->rel1.id_y >= 0) - ep->param1.rel1_to_y = ed->table_parts[ep->param1.description->rel1.id_y % ed->table_parts_size]; - if (ep->param1.description->rel2.id_x >= 0) - ep->param1.rel2_to_x = ed->table_parts[ep->param1.description->rel2.id_x % ed->table_parts_size]; - if (ep->param1.description->rel2.id_y >= 0) - ep->param1.rel2_to_y = ed->table_parts[ep->param1.description->rel2.id_y % ed->table_parts_size]; - } - ep->param2.rel1_to_x = NULL; - ep->param2.rel1_to_y = NULL; - ep->param2.rel2_to_x = NULL; - ep->param2.rel2_to_y = NULL; + ep->param1.rel1_to_x = ep->param1.rel1_to_y = NULL; + ep->param1.rel2_to_x = ep->param1.rel2_to_y = NULL; + + if (ep->param1.description->rel1.id_x >= 0) + ep->param1.rel1_to_x = ed->table_parts[ep->param1.description->rel1.id_x % ed->table_parts_size]; + if (ep->param1.description->rel1.id_y >= 0) + ep->param1.rel1_to_y = ed->table_parts[ep->param1.description->rel1.id_y % ed->table_parts_size]; + if (ep->param1.description->rel2.id_x >= 0) + ep->param1.rel2_to_x = ed->table_parts[ep->param1.description->rel2.id_x % ed->table_parts_size]; + if (ep->param1.description->rel2.id_y >= 0) + ep->param1.rel2_to_y = ed->table_parts[ep->param1.description->rel2.id_y % ed->table_parts_size]; + + ep->param2.rel1_to_x = ep->param2.rel1_to_y = NULL; + ep->param2.rel2_to_x = ep->param2.rel2_to_y = NULL; + if (ep->param2.description) { if (ep->param2.description->rel1.id_x >= 0) @@ -145,12 +125,12 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, char *d1, double v1, if (ep->param2.description->rel2.id_y >= 0) ep->param2.rel2_to_y = ed->table_parts[ep->param2.description->rel2.id_y % ed->table_parts_size]; } + if (ep->description_pos == 0.0) ep->chosen_description = ep->param1.description; else ep->chosen_description = ep->param2.description; - if (!ep->chosen_description) - ep->chosen_description = ep->param2.description; + ed->dirty = 1; }