diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-07-24 12:37:17 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-24 12:37:17 -0300 |
commit | 6e3c7fe5fe574ceeb056e4d1f697b0ec719801ec (patch) | |
tree | 369ddd60e19cb265df1454dff5e233d2711fd835 /scene/main/viewport.cpp | |
parent | 0b75f894c3849f891a8876fcf0f4e62f0a5f2134 (diff) | |
parent | be560a750c363355ad077331bf6bdbc62c6b2762 (diff) |
Merge pull request #5803 from jarfil/issue/origin5695-pr
Fix tooltips blinking
Diffstat (limited to 'scene/main/viewport.cpp')
-rw-r--r-- | scene/main/viewport.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index bdb2754e5e..356ebc64c0 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2034,8 +2034,22 @@ void Viewport::_gui_input_event(InputEvent p_event) { } + bool is_tooltip_shown = false; - if (can_tooltip) { + if (gui.tooltip_popup) { + if (can_tooltip) { + String tooltip = over->get_tooltip(gui.tooltip->get_global_transform().xform_inv(mpos)); + + if (tooltip.length() == 0) + _gui_cancel_tooltip(); + else if (tooltip == gui.tooltip_label->get_text()) + is_tooltip_shown = true; + } + else + _gui_cancel_tooltip(); + } + + if (can_tooltip && !is_tooltip_shown) { gui.tooltip=over; gui.tooltip_pos=mpos;//(parent_xform * get_transform()).affine_inverse().xform(pos); |