Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label with custom font gets misaligned after resizing with 2d scretch mode #42257

Closed
manokara opened this issue Sep 23, 2020 · 2 comments
Closed

Comments

@manokara
Copy link
Contributor

manokara commented Sep 23, 2020

Godot version:
3.2.3 Stable Official

OS & Hardware:
Solus/Linux 5.6.19
Ryzen 5 2400G (+RX Vega 11 iGPU)
GLES2 renderer

Issue description:
Resizing the window shifts the label (which is anchored to the center) slightly to the right, making it not align with the Node2Ds behind it. This does not happen with the default font, and I have not tested if this also happens with a BitmapFont. My repro project below uses a DynamicFont.

Steps to reproduce:

  1. Add one or more Node2Ds to the scene
  2. Add a root Control node that covers the entire viewport and a Label as a child anchored to Center
  3. Set viewport stretch mode to 2d
  4. Run the scene: Resize the window so it becomes small enough, then resize it back to the original size or larger. The Node2Ds will not align with the label.

Minimal reproduction project:
https://mega.nz/file/fVdxEIYC#1XaMSVvjFN7YKNG8JLP5F38ooe1WtpLa7ffi5jjBbi4

@Calinou
Copy link
Member

Calinou commented Sep 23, 2020

As a workaround, try disabling Rendering > Quality > Dynamic Fonts > Use Oversampling in the Project Settings.

You can also enforce a minimum window size to prevent the window from being resized to a very small size, which tends to cause this kind of issue. To do so, call OS.min_window_size = Vector2(<width>, <height>) in any script's _ready() method. This will be done by default if #37260 is merged.

@Calinou
Copy link
Member

Calinou commented Mar 17, 2021

Duplicate of #37242 (same cause).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants