Elementary els_scroller: Fix a bug with ui-mirroring.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 20 Feb 2011 16:00:00 +0000 (16:00 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 20 Feb 2011 16:00:00 +0000 (16:00 +0000)
Bug happened when child_w < scroller_w and ui-mirroring was on.
The position calculated was smaller than 0 and thus not correct.

git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@57194 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/els_scroller.c

index 7d89d0b..c90e189 100644 (file)
@@ -158,10 +158,11 @@ _elm_smart_scroller_x_mirrored_get(Evas_Object *obj, Evas_Coord x)
 {
    API_ENTRY return x;
 
-   Evas_Coord cw, ch, w;
+   Evas_Coord cw, ch, w, ret;
    elm_smart_scroller_child_viewport_size_get(obj, &w, NULL);
    sd->pan_func.child_size_get(sd->pan_obj, &cw, &ch);
-   return (cw - (x + w));
+   ret = (cw - (x + w));
+   return (ret >= 0) ? ret : 0;
 }
 
 void