aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_object_grid.c
diff options
context:
space:
mode:
authorHosang Kim <hosang12.kim@samsung.com>2014-08-14 11:14:49 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-08-14 11:14:49 +0900
commitb4d013d2ec4641bdc2189e35264904632ff7e45a (patch)
treeb23b78ef4c8674e2ae50a59374db5d3ff5c38feb /src/lib/evas/canvas/evas_object_grid.c
parentedje_pick: fix a segfault on 'set' copy (diff)
downloadefl-b4d013d2ec4641bdc2189e35264904632ff7e45a.tar.gz
Grid: fix a mirroring bug
Summary: When the grid is mirrored, originally code is just changed (x1,y1) to (x2,y2). I fix calculate logic for the x-axis. @fix Test Plan: 1. elementary_test -> grid 2. click UI-MIRRORING toggle Reviewers: Hermet, woohyun, raster, seoz Reviewed By: seoz Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1325
Diffstat (limited to 'src/lib/evas/canvas/evas_object_grid.c')
-rw-r--r--src/lib/evas/canvas/evas_object_grid.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/lib/evas/canvas/evas_object_grid.c b/src/lib/evas/canvas/evas_object_grid.c
index a866c42780..a0debc738a 100644
--- a/src/lib/evas/canvas/evas_object_grid.c
+++ b/src/lib/evas/canvas/evas_object_grid.c
@@ -208,7 +208,7 @@ _evas_object_grid_smart_calculate(Evas_Object *o)
{
Eina_List *l;
Evas_Object_Grid_Option *opt;
- Evas_Coord x, y, w, h, vw, vh, t;
+ Evas_Coord x, y, w, h, vw, vh;
Eina_Bool mirror;
EVAS_OBJECT_GRID_DATA_GET_OR_RETURN(o, priv);
@@ -222,15 +222,18 @@ _evas_object_grid_smart_calculate(Evas_Object *o)
{
Evas_Coord x1, y1, x2, y2;
- x1 = x + ((w * opt->x) / vw);
- y1 = y + ((h * opt->y) / vh);
- x2 = x + ((w * (opt->x + opt->w)) / vw);
- y2 = y + ((h * (opt->y + opt->h)) / vh);
- if (mirror)
+ if (!mirror)
+ {
+ x1 = x + ((w * opt->x) / vw);
+ x2 = x + ((w * (opt->x + opt->w)) / vw);
+ }
+ else
{
- t = x1; x1 = x2; x2 = t;
- t = y1; y1 = y2; y2 = t;
+ x1 = x + ((w * (vw - (opt->x + opt->w))) / vw);
+ x2 = x + ((w * (vw - opt->x)) / vw);
}
+ y1 = y + ((h * opt->y) / vh);
+ y2 = y + ((h * (opt->y + opt->h)) / vh);
evas_object_move(opt->obj, x1, y1);
evas_object_resize(opt->obj, x2 - x1, y2 - y1);
}