Fix tooltip content being cut off at some display scales
When getting the minimum size for a tooltip, we get the value as a Vector2. Window::set_size() takes a Vector2i, so this size was getting truncated. At certain display scales, this could be enough to cut off part of the tooltip. Updated to call Vector2::ceil() to round up before calling Window::set_size()
Fixes #91958
(cherry picked from commit ca8e3d4923
)
This commit is contained in:
parent
2eec361f5f
commit
302af188a1
|
@ -1511,6 +1511,7 @@ void Viewport::_gui_show_tooltip() {
|
||||||
r.size *= win_scale;
|
r.size *= win_scale;
|
||||||
vr = window->get_usable_parent_rect();
|
vr = window->get_usable_parent_rect();
|
||||||
}
|
}
|
||||||
|
r.size = r.size.ceil();
|
||||||
r.size = r.size.min(panel->get_max_size());
|
r.size = r.size.min(panel->get_max_size());
|
||||||
|
|
||||||
if (r.size.x + r.position.x > vr.size.x + vr.position.x) {
|
if (r.size.x + r.position.x > vr.size.x + vr.position.x) {
|
||||||
|
|
Loading…
Reference in New Issue