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

Main editor toolbar icons are blurry #88165

Closed
davthedev opened this issue Feb 10, 2024 · 8 comments · Fixed by #91802
Closed

Main editor toolbar icons are blurry #88165

davthedev opened this issue Feb 10, 2024 · 8 comments · Fixed by #91802

Comments

@davthedev
Copy link
Contributor

Tested versions

  • Reproducible on 4.3-dev3

System information

Godot v4.3.dev3 - Ubuntu 22.04.3 LTS 22.04 - X11 - Vulkan (Mobile) - integrated Intel(R) Iris(R) Plus Graphics (ICL GT2) () - Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (8 Threads)

Issue description

The icons on the main toolbar are blurry.

image

You can compare with those from the side palette which are drawn correctly. The three-dot "more" icon is a good point of comparison.

Steps to reproduce

Create a new project and see the main editor window. Make sure you run a non-hidpi setup with 1920x1080 monitor, and OS scaling setting ideally set to 100% for instance, to avoid any default upscaling taking place which would make the issue not visible.

Minimal reproduction project (MRP)

N/A, sufficient to open an empty project in the editor

@Calinou
Copy link
Member

Calinou commented Feb 10, 2024

For me, it's the opposite on 4.3.dev3: the main toolbar's 3 vertical dots are almost pixel-perfect while the ones in the dock are slightly blurry.

image

I'm using 100% editor scale with the editor in a maximized 3840×2160 window.

@davthedev
Copy link
Contributor Author

Non-integer spacing somewhere?

There has been a complete refactoring of the editor theme generation with emphasis on margins/spacings. Could this be a side effect?

@Mickeon
Copy link
Contributor

Mickeon commented Feb 14, 2024

I can certainly confirm the issue. it is difficult to visualize a comparison, but something has changed and they definitely look blurrier as a result.

Image from Gyazo

@Maran23
Copy link
Contributor

Maran23 commented Feb 20, 2024

Just found this today as well. Also not sure where this comes from, resizing does not fix it.
image

@williamsrb
Copy link

williamsrb commented Mar 7, 2024

A quick comparison of versions:
image

My guess is that it's related to SVG_Renderer from Freetype (this file, maybe? godot/thirdparty/freetype/src/svg/ftsvg.c)
It was update here 008d3de last time, so since 4.2.1 it's probably an issue.

I'm not a C developer. Maybe @bruvzg could help us confirm this bug is related to Freetype update. By the way, sorry for bothering you (tagging).

@bruvzg
Copy link
Member

bruvzg commented Mar 7, 2024

My guess is that it's related to SVG_Renderer from Freetype (this file, maybe? godot/thirdparty/freetype/src/svg/ftsvg.c)

No, FreeType is not related to the icons in any way. Most likely it's something with icon positions (theme or control changes).

@Maran23
Copy link
Contributor

Maran23 commented May 10, 2024

I just did a bisect and this issue seems to be a regression from #64351, cc @Rindbee
Reverting that PR fixes it for me as well.

Edit: I now only reverted the changes in the NOTIFICATION_DRAW method. Everything works still, so the problem really is somewhere in the drawing code of button.cpp

@davthedev
Copy link
Contributor Author

Interesting find!

Then we should look for drawing code that puts images at non-integer coordinates. This is a probable culprit.

UI toolkits of long ago may have had logic that automatically snap images and primitives to the nearest pixel. In Godot, if you draw something between pixels, it gets blurry. Rounding coords to the closest pixel after calculation may be a solution.

One suggestion would be to recommend checking the result on non-hidpi displays every time there is UI code being worked on. Perhaps add a little mention in the developer docs about that? Because someone who only works on 4K/Retina/hidpi or similar screens would never see the issue on his configuration.

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

Successfully merging a pull request may close this issue.

8 participants