Merge pull request #30462 from sparkart/master

Fix issue with displaying empty tooltip hint
This commit is contained in:
Rémi Verschelde 2019-07-10 13:33:30 +02:00 committed by GitHub
commit 670e88c749
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1431,6 +1431,7 @@ void Viewport::_gui_show_tooltip() {
Control *which = NULL;
String tooltip = _gui_get_tooltip(gui.tooltip, gui.tooltip->get_global_transform().xform_inv(gui.tooltip_pos), &which);
tooltip = tooltip.strip_edges();
if (tooltip.length() == 0)
return; // bye
@ -1460,7 +1461,7 @@ void Viewport::_gui_show_tooltip() {
gui.tooltip_label->set_anchor_and_margin(MARGIN_TOP, Control::ANCHOR_BEGIN, ttp->get_margin(MARGIN_TOP));
gui.tooltip_label->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -ttp->get_margin(MARGIN_RIGHT));
gui.tooltip_label->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_END, -ttp->get_margin(MARGIN_BOTTOM));
gui.tooltip_label->set_text(tooltip.strip_edges());
gui.tooltip_label->set_text(tooltip);
}
rp->add_child(gui.tooltip_popup);