els_tooltip: Fix to show correct arrow type

Summary:
Current calculation for arrow type is not based on mouse position.
Consequently, tooltip arrow type is incorrect when tooltip shows on
mouse position with ELM_TOOLTIP_ORIENT_NONE.

Test Plan:
1. Execute "Tooltip" in elementary_test
2. Hover mouse on any button and move mouse

Reviewers: Hermet, raster, woohyun

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7074
This commit is contained in:
Jaehyun Cho 2018-09-21 15:05:43 +09:00 committed by Hermet Park
parent 54c68e445b
commit c6f40ce1ae
1 changed files with 12 additions and 6 deletions

View File

@ -654,12 +654,18 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt)
if ((py + cy) > (ch / 2)) ty = cy + py - 1 - th;
else ty = cy + py + 1;
}
if (ow > 1) rel_x = (double)((ox + (ow / 2)) - ((tx - cx) + (tw / 2))) /
(double)(ow / 2);
else rel_x = 0.0;
if (oh > 1) rel_y = (double)((oy + (oh / 2)) - ((ty - cy) + (th / 2))) /
(double)(oh / 2);
else rel_y = 0.0;
if (inside_eventarea)
{
rel_x = (px - (tx - cx)) / (double)tw;
rel_y = (py - (ty - cy)) / (double)th;
}
else
{
rel_x = (ox + (ow / 2) - (tx - cx)) / (double)tw;
rel_y = (oy + (oh / 2) - (ty - cy)) / (double)th;
}
tx += basex;
ty += basey;
// XXX: if this is a window for toolkit this relies on abs positioning