godot icon indicating copy to clipboard operation
godot copied to clipboard

Vertical scrollbar is visible in all popup menus when using a custom display scale

Open passivestar opened this issue 1 year ago • 9 comments

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:

image

EDIT: Correction, this has nothing to do with a theme, this is with no theme:

image

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

passivestar avatar Mar 14 '24 14:03 passivestar

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

AThousandShips avatar Mar 14 '24 14:03 AThousandShips

Can you test if it's fixed by: https://github.com/godotengine/godot/pull/89462

alas, not fixed by that PR

passivestar avatar Mar 14 '24 14:03 passivestar

  • maybe related https://github.com/godotengine/godot/pull/87462

It might be caused by the content margins on the scroll container's theme.

kitbdev avatar Mar 15 '24 21:03 kitbdev

#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.

Koyper avatar Apr 13 '24 17:04 Koyper

Fixed by #86553.

akien-mga avatar Apr 18 '24 10:04 akien-mga

Fixed by https://github.com/godotengine/godot/pull/86553

I'm afraid not

Screenshot 2024-04-18 at 19 32 01

passivestar avatar Apr 18 '24 15:04 passivestar

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?

smntic avatar Apr 19 '24 01:04 smntic

@akien-mga should this be reopened?

passivestar avatar Apr 22 '24 11:04 passivestar

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?

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.

Koyper avatar Apr 24 '24 15:04 Koyper