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)
downloadefl-eae53f221809b7e66bae1476f5697e9e4153ceaa.tar.gz
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)
else return EINA_FALSE;
elm_obj_pan_pos_max_get(sd->pan_obj, &pan_max_x, &pan_max_y);
- if (x < 0) x = 0;
- if (x > pan_max_x) x = pan_max_x;
- if (y < 0) y = 0;
- if (y > pan_max_y) y = pan_max_y;
+ if (x < 0)
+ x = 0;
+ else if (x > pan_max_x)
+ x = pan_max_x;
+ if (y < 0)
+ y = 0;
+ else if (y > pan_max_y)
+ y = pan_max_y;
elm_interface_scrollable_content_pos_set(obj, x, y, EINA_TRUE);