Merge pull request #55852 from jmb462/fix-bad-tooltip-offset

This commit is contained in:
Rémi Verschelde 2021-12-12 12:42:43 +01:00 committed by GitHub
commit 03aaa1480d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1183,7 +1183,7 @@ void Viewport::_gui_show_tooltip() {
Control *tooltip_owner = nullptr;
String tooltip_text = _gui_get_tooltip(
gui.tooltip_control,
gui.tooltip_control->get_screen_transform().xform_inv(gui.last_mouse_pos),
gui.tooltip_control->get_global_transform().xform_inv(gui.last_mouse_pos),
&tooltip_owner);
tooltip_text = tooltip_text.strip_edges();
if (tooltip_text.is_empty()) {
@ -1712,7 +1712,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
if (gui.tooltip_popup) {
if (gui.tooltip_control) {
String tooltip = _gui_get_tooltip(over, gui.tooltip_control->get_screen_transform().xform_inv(mpos));
String tooltip = _gui_get_tooltip(over, gui.tooltip_control->get_global_transform().xform_inv(mpos));
if (tooltip.length() == 0) {
_gui_cancel_tooltip();