summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_transit.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-13 17:41:20 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-13 18:09:19 +0900
commit89733b22f6287f0c9126acc93a2b1dae590ae4dd (patch)
tree557083c042dae7d3bfecc403bc28dbeee64de94f /src/lib/elementary/elm_transit.c
parent83ea35541ceea5583528b09daf397deecb354b97 (diff)
downloadefl-89733b22f6287f0c9126acc93a2b1dae590ae4dd.tar.gz
efl_gfx_fill: Use Eina.Rectangle for fill (EO)
Diffstat (limited to 'src/lib/elementary/elm_transit.c')
-rw-r--r--src/lib/elementary/elm_transit.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/elementary/elm_transit.c b/src/lib/elementary/elm_transit.c
index 0ff99faed3..69c9604c7a 100644
--- a/src/lib/elementary/elm_transit.c
+++ b/src/lib/elementary/elm_transit.c
@@ -480,7 +480,6 @@ _recover_image_uv(Evas_Object *obj, Evas_Map *map, Eina_Bool revert, Eina_Bool b
//Need to handle uvs only for image objects
int iw, ih;
int x, y, w, h;
- int fill_x, fill_y, fill_w, fill_h;
const char *type = evas_object_type_get(obj);
if ((!type) || (strcmp(type, "image"))) return EINA_FALSE;
@@ -507,16 +506,19 @@ _recover_image_uv(Evas_Object *obj, Evas_Map *map, Eina_Bool revert, Eina_Bool b
//Zooming image fill area.
else
{
- efl_gfx_fill_get(obj, &fill_x, &fill_y, &fill_w, &fill_h);
+ Eina_Rectangle fill;
+
+ fill = efl_gfx_fill_get(obj);
efl_gfx_size_get(obj, &w, &h);
- double rate_x = (double) w / (double) fill_w;
- double rate_y = (double) h / (double) fill_h;
- double rate_x2 = (double) iw / (double) fill_w;
- double rate_y2 = (double) ih / (double) fill_h;
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_rectangle_is_valid(&fill), EINA_FALSE);
+ double rate_x = (double) w / (double) fill.w;
+ double rate_y = (double) h / (double) fill.h;
+ double rate_x2 = (double) iw / (double) fill.w;
+ double rate_y2 = (double) ih / (double) fill.h;
- x = -(int)((double) fill_x * rate_x2);
- y = -(int)((double) fill_y * rate_y2);
+ x = -(int)((double) fill.x * rate_x2);
+ y = -(int)((double) fill.y * rate_y2);
w = (int)(((double) iw) * rate_x) + x;
h = (int)(((double) ih) * rate_y) + y;
}