diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 337403068e..c3df9add74 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -734,3 +734,7 @@ 2012-11-30 ChunEon Park (Hermet) * emit the signals for content_set/unset text_set/unset one time! + +2012-12-02 Mike Blumenkrantz + + * Fix case where tooltips could go offscreen unnecessarily diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index 61a6f07d3b..081d0cb41b 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -69,6 +69,7 @@ Fixes: * Fix the mapbuf to update it's content correcltly evenif they go outside of the buffer. * Fix the naviframe to resize it's items which are inserted. * Fix the naviframe to send signal emits one time for content show/hide, text show/hide. + * Fix case where tooltips could go offscreen unnecessarily Removals: diff --git a/legacy/elementary/src/lib/els_tooltip.c b/legacy/elementary/src/lib/els_tooltip.c index a2e18a30c5..4d8b74397d 100644 --- a/legacy/elementary/src/lib/els_tooltip.c +++ b/legacy/elementary/src/lib/els_tooltip.c @@ -426,22 +426,36 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt) TTDBG("INIT (INTERPRETED)\n"); } TTDBG("ADJUST (POINTER): tx=%d,ty=%d\n", tx, ty); - if (tx < 0) + if ((tx < 0) || (tx + tw > cw)) { /* if we're offscreen, try to flip over the Y axis */ - if (abs((tx + 2 * tw) - cw) < abs(tx)) + if ((tx < 0) && (abs((tx + 2 * tw) - cw) < abs(tx))) tx += tw; + else if (tx + tw > cw) + { + int test_x = tx - tw; + + if ((test_x >= 0) || (tx + tw - cw > abs(test_x))) + tx -= tw; + } } else if ((tx > px) && (px > tw)) { if (tx + tw < cw) tx += tw; } - if (ty < 0) + if ((ty < 0) || (ty + th > ch)) { /* if we're offscreen, try to flip over the X axis */ - if (abs((ty + 2 * th) - ch) < abs(ty)) + if ((ty < 0) && (abs((ty + 2 * th) - ch) < abs(ty))) ty += th; + else if (ty + th > ch) + { + int test_y = ty - th; + + if ((test_y >= 0) || (ty + th - ch > abs(test_y))) + ty -= th; + } } else if ((ty > py) && (py > th)) {