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

Custom .svg icons blurry in some places inside the editor #73491

Closed
bitbrain opened this issue Feb 17, 2023 · 6 comments
Closed

Custom .svg icons blurry in some places inside the editor #73491

bitbrain opened this issue Feb 17, 2023 · 6 comments

Comments

@bitbrain
Copy link
Contributor

bitbrain commented Feb 17, 2023

Godot version

4.0-rc2

System information

Windows 10, 4K monitor

Issue description

Custom .svg icons occur blurry in certain parts of the editor on higher resolution monitors (e.g. 4K) and 200% editor scaling and Scale With Editor Scale turned on. Note, that this only affects custom icons and native editor icons seem to be fine in the MRP.

Given a node defines something like this:

@icon("tree.svg")
class_name CustomNode extends Node2D

@export var node:Node2D

it will occur like this in the editor:

219475155-758bafde-ad52-4821-8d83-0ac910c0b680

All the red circles are places where the icon seems to be blurry and does not scale correctly with the editor. Only the green circle shows the correct version of the icon.

Steps to reproduce

  1. open MRP on a 4K monitor
  2. set editor scaling to 200%

Minimal reproduction project

blurry-icons.zip

@bitbrain bitbrain changed the title Custom .svg icons blurry in some paces inside the editor Custom .svg icons blurry in some places inside the editor Feb 17, 2023
@bitbrain
Copy link
Contributor Author

I cannot help but also find that the blurred versions look a bit... squashed?

Blurry version:
1
Sharp version:
2

@coppolaemilio
Copy link
Member

coppolaemilio commented Feb 17, 2023

I think there are a couple factors making it blurry. The source svg according to figma is: 16.88 x 15.06. Making a "frame" with it being 16 x 16 might result in less blurriness because it doesn't have to make those decimal calculations when rasterizing.
There's also the size of the source image. I usually get better results (might be psychological, haven't compared) when I make a bigger image, so instead of going for a 16x16 I try to use 32x32 or 64x64 on the svg file.
I tried making your icon on a 32x32 frame
image

And got better results in editor:

image

Here it's the tree2.svg if you want to try it out:
tree2

Hope that helps!

@DarkMessiah
Copy link
Contributor

😁
image

@DricomDragon
Copy link

Icon displayed on the left of "BehaveTree" seems to be a bit oversized. May be related to #75845 ?

@coppolaemilio
Copy link
Member

This was fixed recently with: #75472

@akien-mga akien-mga added this to the 4.1 milestone Apr 9, 2023
@Zylann
Copy link
Contributor

Zylann commented Sep 3, 2023

I found it's not just custom icons
image

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

7 participants