From: Jeonghyun Yun Date: Wed, 29 Nov 2017 06:29:39 +0000 (+0900) Subject: focus: Add second_level for focus direction weight calculate X-Git-Tag: submit/tizen/20171130.115009~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a7d0c00ffef3871765a4e2253ec3ead3f68faeec;p=platform%2Fupstream%2Felementary.git focus: Add second_level for focus direction weight calculate @tizen_fix Change-Id: Ifab1a45485741b12ac68a17a5fb24581dab3bce8 Signed-off-by: Jeonghyun Yun --- diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index ebf6e64c0..9f66aa866 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -2082,6 +2082,9 @@ _elm_widget_focus_direction_weight_get(const Evas_Object *obj1, double x1, yy1, x2, yy2, xx1, yyy1, xx2, yyy2; double ax, ay, cx, cy; double weight = -1.0, g = 0.0; + // TIZEN_ONLY(20171129): add second_level for weight calculate + Eina_Bool second_level = EINA_FALSE; + // if (obj1 == obj2) return 0.0; @@ -2230,19 +2233,47 @@ _elm_widget_focus_direction_weight_get(const Evas_Object *obj1, { if (degree == 0.0) { - if ((_R(xx2) < 0) || (_R(yy2) > 0) || (_R(yyy2) < 0)) return 0.0; + // TIZEN_ONLY(20171129): add second_level for weight calculate + //if ((_R(xx2) < 0) || (_R(yy2) > 0) || (_R(yyy2) < 0)) return 0.0; + if ((_R(xx2) < 0) || (_R(yy2) > 0) || (_R(yyy2) < 0)) + { + if (xx1 <= x2) second_level = EINA_TRUE; + else return 0.0; + } + // } else if (degree == 90.0) { - if ((_R(yyy2) < 0) || (_R(x2) > 0) || (_R(xx2) < 0)) return 0.0; + // TIZEN_ONLY(20171129): add second_level for weight calculate + //if ((_R(yyy2) < 0) || (_R(x2) > 0) || (_R(xx2) < 0)) return 0.0; + if ((_R(yyy2) < 0) || (_R(x2) > 0) || (_R(xx2) < 0)) + { + if (yyy1 <= yy2) second_level = EINA_TRUE; + else return 0.0; + } + // } else if (degree == 180.0) { - if ((_R(x2) > 0) || (_R(yy2) > 0) || (_R(yyy2) < 0)) return 0.0; + // TIZEN_ONLY(20171129): add second_level for weight calculate + //if ((_R(x2) > 0) || (_R(yy2) > 0) || (_R(yyy2) < 0)) return 0.0; + if ((_R(x2) > 0) || (_R(yy2) > 0) || (_R(yyy2) < 0)) + { + if (x1 >= xx2) second_level = EINA_TRUE; + else return 0.0; + } + // } else if (degree == 270.0) { - if ((_R(yy2) > 0) || (_R(x2) > 0) || (_R(xx2) < 0)) return 0.0; + // TIZEN_ONLY(20171129): add second_level for weight calculate + //if ((_R(yy2) > 0) || (_R(x2) > 0) || (_R(xx2) < 0)) return 0.0; + if ((_R(yy2) > 0) || (_R(x2) > 0) || (_R(xx2) < 0)) + { + if (yy1 >= yyy2) second_level = EINA_TRUE; + else return 0.0; + } + // } else { @@ -2389,6 +2420,10 @@ _elm_widget_focus_direction_weight_get(const Evas_Object *obj1, #undef _R + // TIZEN_ONLY(20171129): add second_level for weight calculate + if (second_level) return 1.0 / (weight * 1000000.0); + // + return 1.0 / weight; }