Godot: Buttons disappear on window resize

Created on 23 Mar 2020  路  11Comments  路  Source: godotengine/godot

Godot version:
3.2.1

OS/device including version:
macOS Catalina 10.15.3 / MacBookPro11,1

Issue description:
Buttons seem to disappear when the window is resized vertically.
Check the attached video.

Godot-_Bug.mov.zip

Steps to reproduce:
Control Node -> Center Container -> Vertical Box Container -> Button_1, Button_2...

Minimal reproduction project:

bug confirmed rendering

Most helpful comment

Minimal reproduction project:

Godot Bug.zip

All 11 comments

@drmar Please upload a minimal reproduction project to make this easier to troubleshoot.

Also, which stretch mode settings did you use in the project?

Also, which stretch mode settings did you use in the project?

Stretch Mode: 2d
Stretch Aspect: keep

Please upload a minimal reproduction project to make this easier to troubleshoot.

I will do this shortly.

Minimal reproduction project:

Godot Bug.zip

I can reproduce this on Godot 3.2.

I can reproduce this on Godot 3.2 on Linux. It happens whenever you resize the window width or height to be 1 pixel wide.

You can work around this by defining a minimum window size in any script:

func _ready():
    OS.min_window_size = Vector2(64, 64)

I wonder if we should set a minimum window size by default to prevent this bug. This is fairly common in applications after all.

I actually don't think that the bug happens necessarily when the window is 1px by itself.
I believe something else has to happen in conjunction with the window resize for the bug to appear.
I will do more testing tomorrow.

This doesn't occur if you set the stretch mode to disabled or viewport. It only occurs when setting the stretch mode to 2d with font oversampling enabled. If you disable Rendering > Quality > Dynamic Fonts > Use Oversampling in the project settings, it won't occur when using the 2d stretch mode.

This means it's yet another bug related to font oversampling.

The size and position of the button node increase unacceptably, and it gets out of the window. This only happens to buttons.

Here is the demo. Resize the window to the smallest size and restore it, and You can see the size of the play button increases.

Edit: It's because of custom fonts. without custom font it works fine as drmar said.

This means it's yet another bug related to font oversampling.

I also believe that it has something to do with custom fonts. It you recreate my minimal project that I uploaded initially without custom fonts, the buttons will NOT disappear, even when the window is resized to 1px.

@drmar The default font is a BitmapFont. BitmapFonts don't make use of font oversampling, which is why this bug doesn't occur with BitmapFonts.

@Calinou Thanks for the info!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ducdetronquito picture ducdetronquito  路  3Comments

Zylann picture Zylann  路  3Comments

mefihl picture mefihl  路  3Comments

Spooner picture Spooner  路  3Comments

EdwardAngeles picture EdwardAngeles  路  3Comments