elm_interface_scrollable: correctly handle bouncing
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Fri, 25 Oct 2019 18:04:46 +0000 (14:04 -0400)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 11 Nov 2019 02:20:39 +0000 (11:20 +0900)
Summary:
if bounding is enabled, those values can get smaller and bigger than the
max value.

ref T4918

Depends on D9906

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T4918

Differential Revision: https://phab.enlightenment.org/D9907

src/lib/elementary/elm_interface_scrollable.c

index cab7dc2..18cc4af 100644 (file)
@@ -498,10 +498,10 @@ _elm_direction_arrows_eval(Elm_Scrollable_Smart_Interface_Data *sid)
    elm_obj_pan_pos_min_get(sid->pan_obj, &minx, &miny);
    elm_obj_pan_pos_get(sid->pan_obj, &x, &y);
 
-   if (x == minx) go_left = EINA_FALSE;
-   if (x == (mx + minx)) go_right = EINA_FALSE;
-   if (y == miny) go_up = EINA_FALSE;
-   if (y == (my + miny)) go_down = EINA_FALSE;
+   if (x <= minx) go_left = EINA_FALSE;
+   if (x >= (mx + minx)) go_right = EINA_FALSE;
+   if (y <= miny) go_up = EINA_FALSE;
+   if (y >= (my + miny)) go_down = EINA_FALSE;
    if (go_left != sid->go_left)
      {
         if (go_left)