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
This commit is contained in:
Shuhrat Dehkanov 2016-04-11 17:41:28 +05:30 committed by Amitesh Singh
parent 810ebb5db8
commit eae53f2218
1 changed files with 8 additions and 4 deletions

View File

@ -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);