summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitalii Vorobiov <vi.vorobiov@samsung.com>2016-06-06 20:46:14 +0300
committerVitalii Vorobiov <vi.vorobiov@samsung.com>2016-07-21 16:40:49 +0300
commit372999fffbaf0ae2883b8a0e6bc1fde029890df3 (patch)
tree40b764d779302a3a3d1c15182f2051cd675059ef
parente70369015f36a2a1e13bc441b3d06e9c40d43b80 (diff)
downloadefl-372999fffbaf0ae2883b8a0e6bc1fde029890df3.tar.gz
edje_edit: fix map API (light, perspective, rotation)
it should be possible to set light or perspective to NULL and return -1 when nothing is set also ability to send NULL point to store rotation @fix
-rw-r--r--src/lib/edje/edje_edit.c41
1 files changed, 28 insertions, 13 deletions
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 03bd8fdd00..1df23dea6a 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -7599,7 +7599,9 @@ edje_edit_state_map_light_get(Evas_Object *obj, const char *part, const char *st
GET_PD_OR_RETURN(NULL);
- erl = ed->table_parts[pd->map.id_light % ed->table_parts_size];
+ if (pd->map.id_light == -1) return NULL;
+
+ erl = ed->table_parts[pd->map.id_light];
if (erl->part->name)
return eina_stringshare_add(erl->part->name);
@@ -7613,7 +7615,9 @@ edje_edit_state_map_rotation_center_get(Evas_Object *obj, const char *part, cons
GET_PD_OR_RETURN(NULL);
- erl = ed->table_parts[pd->map.rot.id_center % ed->table_parts_size];
+ if (pd->map.rot.id_center == -1) return NULL;
+
+ erl = ed->table_parts[pd->map.rot.id_center];
if (erl->part->name)
return eina_stringshare_add(erl->part->name);
@@ -7714,9 +7718,9 @@ edje_edit_state_map_rotation_get(Evas_Object *obj, const char *part, const char
{
GET_PD_OR_RETURN(EINA_FALSE);
- *x = TO_DOUBLE(pd->map.rot.x);
- *y = TO_DOUBLE(pd->map.rot.y);
- *z = TO_DOUBLE(pd->map.rot.z);
+ if (x) *x = TO_DOUBLE(pd->map.rot.x);
+ if (y) *y = TO_DOUBLE(pd->map.rot.y);
+ if (z) *z = TO_DOUBLE(pd->map.rot.z);
return EINA_TRUE;
}
@@ -7762,10 +7766,14 @@ edje_edit_state_map_perspective_focal_get(Evas_Object *obj, const char *part, co
EAPI Eina_Bool
edje_edit_state_map_light_set(Evas_Object *obj, const char *part, const char *state, double value, const char *source_part)
{
- if (!source_part) return EINA_FALSE;
+ int src_id = -1;
+
GET_PD_OR_RETURN(EINA_FALSE);
- pd->map.id_light = _edje_part_id_find(ed, source_part);
+ if (source_part)
+ src_id = _edje_part_id_find(ed, source_part);
+
+ pd->map.id_light = src_id;
edje_object_calc_force(obj);
return EINA_TRUE;
@@ -7774,10 +7782,14 @@ edje_edit_state_map_light_set(Evas_Object *obj, const char *part, const char *st
EAPI Eina_Bool
edje_edit_state_map_rotation_center_set(Evas_Object *obj, const char *part, const char *state, double value, const char *source_part)
{
- if (!source_part) return EINA_FALSE;
+ int src_id = -1;
+
GET_PD_OR_RETURN(EINA_FALSE);
- pd->map.rot.id_center = _edje_part_id_find(ed, source_part);
+ if (source_part)
+ src_id = _edje_part_id_find(ed, source_part);
+
+ pd->map.rot.id_center = src_id;
edje_object_calc_force(obj);
return EINA_TRUE;
@@ -7874,7 +7886,9 @@ edje_edit_state_map_perspective_get(Evas_Object *obj, const char *part, const ch
GET_PD_OR_RETURN(NULL);
- erl = ed->table_parts[pd->map.id_persp % ed->table_parts_size];
+ if (pd->map.id_persp == -1) return NULL;
+
+ erl = ed->table_parts[pd->map.id_persp];
if (erl->part->name)
return eina_stringshare_add(erl->part->name);
@@ -7884,12 +7898,13 @@ edje_edit_state_map_perspective_get(Evas_Object *obj, const char *part, const ch
EAPI Eina_Bool
edje_edit_state_map_perspective_set(Evas_Object *obj, const char *part, const char *state, double value, const char *source_part)
{
- int src_id;
+ int src_id = -1;
- if (!source_part) return EINA_FALSE;
GET_PD_OR_RETURN(EINA_FALSE);
- src_id = _edje_part_id_find(ed, source_part);
+ if (source_part)
+ src_id = _edje_part_id_find(ed, source_part);
+
pd->map.id_persp = src_id;
edje_object_calc_force(obj);