Merge pull request #67046 from Cykyrios/fix-invalid-tooltip-position
Fix invalid tooltip position
This commit is contained in:
commit
dcd86f9848
1 changed files with 6 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue