diff options
author | aaronp64 <aaronp.code@gmail.com> | 2024-05-14 19:08:40 -0400 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-16 16:34:31 +0200 |
commit | 302af188a1053031546a5babd1e3f235652bed37 (patch) | |
tree | 5bc02968b47462d29bec53a0175ef02f317115bf | |
parent | 2eec361f5f6a703f8925498e195d36e76c1c2d64 (diff) | |
download | redot-engine-302af188a1053031546a5babd1e3f235652bed37.tar.gz |
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 ca8e3d4923f94eebf8d8b16a8625d1de6df32768)
-rw-r--r-- | scene/main/viewport.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 1302e3c53e..5f9b0b9061 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1511,6 +1511,7 @@ void Viewport::_gui_show_tooltip() { r.size *= win_scale; vr = window->get_usable_parent_rect(); } + r.size = r.size.ceil(); r.size = r.size.min(panel->get_max_size()); if (r.size.x + r.position.x > vr.size.x + vr.position.x) { |