diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-31 11:05:19 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-31 11:05:19 +0100 |
commit | dcd86f98484c241168cc80279da8639d2d5b85e6 (patch) | |
tree | c6a3119700c1df480f3bdf3100ad747c5833f9bc /scene/main | |
parent | 869c2bd6dee72bdb4d205bcc3d958255e7fc1a07 (diff) | |
parent | f0d793405568f9a4dd052d45ccbf8b168fe82019 (diff) |
Merge pull request #67046 from Cykyrios/fix-invalid-tooltip-position
Fix invalid tooltip position
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/viewport.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 02bde19201..f395ede409 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1266,7 +1266,12 @@ void Viewport::_gui_show_tooltip() { r.size = r.size.min(panel->get_max_size()); Window *window = gui.tooltip_popup->get_parent_visible_window(); - Rect2i vr = window->get_usable_parent_rect(); + Rect2i vr; + if (gui.tooltip_popup->is_embedded()) { + vr = gui.tooltip_popup->_get_embedder()->get_visible_rect(); + } else { + vr = window->get_usable_parent_rect(); + } if (r.size.x + r.position.x > vr.size.x + vr.position.x) { // Place it in the opposite direction. If it fails, just hug the border. |