From: discomfitor Date: Wed, 27 Jul 2011 07:12:28 +0000 (+0000) Subject: significantly improve tooltip orientation calculations X-Git-Tag: REL_F_I9500_20120323_1~17^2~2149 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71a72b7f968e40e3add686fbd103d6e230b590ec;p=framework%2Fuifw%2Felementary.git significantly improve tooltip orientation calculations git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@61795 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/els_tooltip.c b/src/lib/els_tooltip.c index 0599c81..fa08df6 100644 --- a/src/lib/els_tooltip.c +++ b/src/lib/els_tooltip.c @@ -398,6 +398,27 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt) else ty = oy + oh; } + if (tx + tw > cw) + { + if (abs(tx - tw) < (tx + tw) - cw) + tx -= tw; + } + else if ((tx < px) && (px < tx + tw)) + { + if (0 < tx - tw) + tx -= tw; + } + if (ty + th > ch) + { + if (abs(ty - th) < (ty + th) - ch) + ty -= th; + } + else if ((ty < py) && (py < ty + th)) + { + if (0 < ty - th) + ty -= th; + } + if (tt->pad.bx * 2 + tw < cw) { if (tx < tt->pad.bx) tx = tt->pad.bx; @@ -410,16 +431,6 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt) else if (ty + th >= ch - tt->pad.by) ty = ch - th - tt->pad.by; } - if (tx + tw > cw) - { - if (abs(tx - tw) < (tx + tw) - cw) - tx -= tw; - } - if (ty + th > ch) - { - if (abs(ty - th) < (ty + th) - ch) - ty -= th; - } evas_object_move(tt->tt_win ? : tt->tooltip, tx, ty); evas_object_resize(tt->tt_win ? : tt->tooltip, tw, th); evas_object_show(tt->tooltip);