godot
godot copied to clipboard
Vertical scrollbar is visible in all popup menus when using a custom display scale
Tested versions
v4.3.dev.custom_build [da945ce62]
Wasn't happening in 4.2.1
System information
Godot v4.3.dev (da945ce62) - macOS 14.2.1 - Vulkan (Forward+) - integrated Apple M1 Max - Apple M1 Max (10 Threads)
Issue description
It's like this in every popup menu:
EDIT: Correction, this has nothing to do with a theme, this is with no theme:
Steps to reproduce
~~Use this theme with 4.3~~
~~This might be mac-specific because I asked another person and found out that it's not happening on windows~~
Open 4.3 and set custom display scale to 1.6
Minimal reproduction project (MRP)
N/A
Sounds related to:
- https://github.com/godotengine/godot/issues/89122
Can you test if it's fixed by:
- https://github.com/godotengine/godot/pull/89462
Can you test if it's fixed by: https://github.com/godotengine/godot/pull/89462
alas, not fixed by that PR
- maybe related https://github.com/godotengine/godot/pull/87462
It might be caused by the content margins on the scroll container's theme.
#86553 will also fix this issue, as I noticed and fixed it there. It was caused by the changes in #87462 per the comment above. At fractional content scales greater than 1.0, truncation of the menu content height during the minimum size calculation can leave the total control menu height slightly shorter than the content, which causes the scroll container to show the vertical scrollbar.
Fixed by #86553.
Fixed by https://github.com/godotengine/godot/pull/86553
I'm afraid not
It seems, in fact, to not be fixed by #86553.
minsize.height += 0.5 * win_scale; // Ensures enough height at fractional content scales to prevent the v_scroll_bar from showing.
Adding 0.5 before set_min_size() truncates to integers rounds down when the decimal height is less than 0.5, like round(). Would it not make more sense to ceil the values instead?
@akien-mga should this be reopened?
Adding 0.5 before
set_min_size()truncates to integers rounds down when the decimal height is less than 0.5, likeround(). Would it not make more sense to ceil the values instead?
I think you're right about this, and I'm not sure exactly why the rounding down behavior was working correctly (it tested correctly). I changed it so that #91114 uses ceil() for consistency with the fix for embedded windows.