summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShuhrat Dehkanov <sh.dehkanov@samsung.com>2016-04-11 17:41:28 +0530
committerAmitesh Singh <amitesh.sh@samsung.com>2016-04-11 17:44:56 +0530
commiteae53f221809b7e66bae1476f5697e9e4153ceaa (patch)
treeaa34bb7b392768950c85543f1267af280f5c70c3
parent810ebb5db8e0ba97756cb0af8d701d973394379a (diff)
genlist: do not evaluate against max coord if the value is negative
Summary: If x is already less than '0', there is no need to check if it is bigger than pan_max_x. Likewise, if y is already less than '0', there is no need to check if it is bigger than pan_max_y. Reviewers: Hermet, cedric, SanghyeonLee, singh.amitesh Reviewed By: singh.amitesh Subscribers: seoz, minkyu, sju27, jpeg Differential Revision: https://phab.enlightenment.org/D3865
-rw-r--r--src/lib/elementary/elm_genlist.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index b5137fc3c7..f20453725e 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -3053,10 +3053,14 @@ _key_action_move(Evas_Object *obj, const char *params)
3053 else return EINA_FALSE; 3053 else return EINA_FALSE;
3054 3054
3055 elm_obj_pan_pos_max_get(sd->pan_obj, &pan_max_x, &pan_max_y); 3055 elm_obj_pan_pos_max_get(sd->pan_obj, &pan_max_x, &pan_max_y);
3056 if (x < 0) x = 0; 3056 if (x < 0)
3057 if (x > pan_max_x) x = pan_max_x; 3057 x = 0;
3058 if (y < 0) y = 0; 3058 else if (x > pan_max_x)
3059 if (y > pan_max_y) y = pan_max_y; 3059 x = pan_max_x;
3060 if (y < 0)
3061 y = 0;
3062 else if (y > pan_max_y)
3063 y = pan_max_y;
3060 3064
3061 elm_interface_scrollable_content_pos_set(obj, x, y, EINA_TRUE); 3065 elm_interface_scrollable_content_pos_set(obj, x, y, EINA_TRUE);
3062 3066