From: Subhransu Mohanty Date: Thu, 4 Aug 2016 00:34:50 +0000 (-0700) Subject: edje: updated the start index of vector resource from 1 to 0 X-Git-Tag: upstream/1.20.0~4944 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d458101a410a6ffc92d2e59f920a6246f833999f;p=platform%2Fupstream%2Fefl.git edje: updated the start index of vector resource from 1 to 0 Reviewers: cedric, jpeg Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4205 Signed-off-by: Cedric Bail --- diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 2f6481c..de5b138 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -2330,7 +2330,7 @@ _handle_vector_image(void) name = parse_str(0); - ed->vg.id = 0; + ed->vg.id = -1; for (i = 0; i < edje_file->image_dir->vectors_count; ++i) { @@ -2342,7 +2342,7 @@ _handle_vector_image(void) } } - if (!ed->vg.id) + if (ed->vg.id < 0) error_and_abort(NULL, "Failed to find the vector resource :%s", name); free(name); @@ -2410,7 +2410,7 @@ st_images_vector(void) vector = edje_file->image_dir->vectors + edje_file->image_dir->vectors_count - 1; vector->entry = tmp; - vector->id = edje_file->image_dir->vectors_count; + vector->id = edje_file->image_dir->vectors_count - 1; } diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 66b1cee..64db709 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -3269,7 +3269,7 @@ static void _edje_svg_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EINA_UNUSED, Edje_Part_Description_Vector *chosen_desc, FLOAT_T pos) { int w, h; - int new_svg = 0; + int new_svg = -1; Efl_VG *root_vg; Eina_Matrix3 matrix; Edje_Vector_Data *start, *end; @@ -3288,7 +3288,7 @@ _edje_svg_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EINA_U new_svg = next_state->vg.id; } } - if (new_svg) // animation with svg id change + if (new_svg >= 0) // animation with svg id change { start = _edje_ref_vector_data(ed, chosen_desc->vg.id); end = _edje_ref_vector_data(ed, new_svg); diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 972ea88..f704a05 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -3142,6 +3142,8 @@ _edje_edit_real_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type { rp->type = EDJE_PART_TYPE_VECTOR; rp->typedata.vector = calloc(1, sizeof(Edje_Real_Part_Vector)); + if (rp->typedata.vector) + rp->typedata.vector->cur.svg_id = -1; rp->object = evas_object_vg_add(ed->base->evas); } else if (ep->type == EDJE_PART_TYPE_IMAGE || ep->type == EDJE_PART_TYPE_PROXY) diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c index 0d43704..10602e4 100644 --- a/src/lib/edje/edje_load.c +++ b/src/lib/edje/edje_load.c @@ -734,7 +734,10 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch case EDJE_PART_TYPE_VECTOR: rp->type = EDJE_PART_TYPE_VECTOR; rp->typedata.vector = calloc(1, sizeof(Edje_Real_Part_Vector)); - if (!rp->typedata.vector) memerr = EINA_TRUE; + if (!rp->typedata.vector) + memerr = EINA_TRUE; + else + rp->typedata.vector->cur.svg_id = -1; break; case EDJE_PART_TYPE_GROUP: