summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangHyeon Lee <dltkdgus1764@gmail.com>2015-05-28 23:07:27 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-05-28 23:07:27 +0900
commita76416f6ba54b7ab274b40faccdec12f3fad54c5 (patch)
treece87534559df08717c142f83be2dc5fb9ab2f97b
parent8278dff6a742c391f7c04c3de1033574d818dbb6 (diff)
Gengrid: fix mirroring bug in gengrid widget.
Summary: Below bugs are exist in gengrid widget when use horizontal mode and mirrored set. 1. Gengrid item is placed wrong position when mirrored set. Current calulation for mirroring in _item_place only consider pan object positions. if widget is mirrored, item should be placed opposited position so object x position must be consider in mirroring calculation also. 2. Gengrid scroll(pan) minimum size is returned wrong value when mirroed set. As the result of 1's calculation present oposite position of items, so align also reversed when mirrored. but current gengrid didn't change align x so minimum size is return wrong value and scroller expanded wrong direction. @fix Test Plan: 1. run elementary_test and set mirroring On 2. run Gengrid2 in elementary_test 3. see how items are placed by push append button repeatly. 4. see scroller shows correct position and items. 5. change usr/bin/test_gengrid.c to set another align value on gengrid and test again. Reviewers: raster, seoz, Hermet, jaehwan Subscribers: Jaehyun, anand.km, eagleeye, singh.amitesh Differential Revision: https://phab.enlightenment.org/D2553
-rw-r--r--src/lib/elm_gengrid.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 5089f2172..3e4335671 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -1252,7 +1252,7 @@ _item_place(Elm_Gen_Item *it,
1252 * mode */ 1252 * mode */
1253 { 1253 {
1254 evas_object_geometry_get(WIDGET(it), NULL, NULL, &ww, NULL); 1254 evas_object_geometry_get(WIDGET(it), NULL, NULL, &ww, NULL);
1255 x = ww - x - wsd->item_width - wsd->pan_x - wsd->pan_x; 1255 x = ww - x - wsd->item_width - wsd->pan_x - wsd->pan_x + ox + ox;
1256 } 1256 }
1257 iw = wsd->item_width; 1257 iw = wsd->item_width;
1258 ih = wsd->item_height; 1258 ih = wsd->item_height;
@@ -1590,10 +1590,11 @@ EOLIAN static void
1590_elm_gengrid_pan_elm_pan_pos_min_get(Eo *obj, Elm_Gengrid_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y) 1590_elm_gengrid_pan_elm_pan_pos_min_get(Eo *obj, Elm_Gengrid_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
1591{ 1591{
1592 Evas_Coord mx = 0, my = 0; 1592 Evas_Coord mx = 0, my = 0;
1593 Eina_Bool mirrored = elm_widget_mirrored_get(psd->wsd->obj);
1593 1594
1594 eo_do(obj, elm_obj_pan_pos_max_get(&mx, &my)); 1595 eo_do(obj, elm_obj_pan_pos_max_get(&mx, &my));
1595 if (x) 1596 if (x)
1596 *x = -mx * psd->wsd->align_x; 1597 *x = -mx * (mirrored ? 1 - psd->wsd->align_x : psd->wsd->align_x);
1597 if (y) 1598 if (y)
1598 *y = -my * psd->wsd->align_y; 1599 *y = -my * psd->wsd->align_y;
1599} 1600}