godot icon indicating copy to clipboard operation
godot copied to clipboard

Keep `GraphNode` port icons crisp at high zoom levels and remove artifacts

Open Geometror opened this issue 2 years ago • 2 comments

With zoom levels up to 207%, the port icons are noticeably stretched. You can also observe interpolation/sampling artifacts because the circle touches all edges of the SVG's viewport. This can be solved with size overrides and adjusting the circle/the image's dimensions.

Before/After: 1QVjFujSBJ AfgNu6m39j

Geometror avatar Jul 09 '23 23:07 Geometror

TIL about ImageTexture.set_size_override(). This method seems pretty useful; I'm surprised it's not exposed as a property, nor in the inspector for ImageTextures (it is for PortableCompressedTexture2D though). It addresses longstanding feature requests after all :slightly_smiling_face:

PS: The class reference description for ImageTexture.set_size_override() is misleading, as it overrides the size the texture is rendered at (only affects 2D). It does not actually resize the image data.

Calinou avatar Jul 09 '23 23:07 Calinou

Same as you, I just learned about that method today and wished I had sooner. (I stumbled upon it accidentally while looking for a way to implement this exact functionality) I think we should definitely expose size_override as a property or increase its visibility in another way, at least through the documentation. When even you, Calinou, didn't know about it, then we need to take some action 😉

Geometror avatar Jul 10 '23 00:07 Geometror

Thanks!

YuriSizov avatar Jul 12 '23 15:07 YuriSizov