summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-07-24 12:37:17 -0300
committerGitHub <noreply@github.com>2016-07-24 12:37:17 -0300
commit6e3c7fe5fe574ceeb056e4d1f697b0ec719801ec (patch)
tree369ddd60e19cb265df1454dff5e233d2711fd835 /scene/main
parent0b75f894c3849f891a8876fcf0f4e62f0a5f2134 (diff)
parentbe560a750c363355ad077331bf6bdbc62c6b2762 (diff)
Merge pull request #5803 from jarfil/issue/origin5695-pr
Fix tooltips blinking
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.cpp16
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);