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

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

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

Geometror
Copy link
Member

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 Geometror added this to the 4.x milestone Jul 9, 2023
@Geometror Geometror requested a review from a team as a code owner July 9, 2023 23:44
@Calinou
Copy link
Member

Calinou commented Jul 9, 2023

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 🙂

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.

@Geometror
Copy link
Member Author

Geometror commented Jul 10, 2023

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 😉

@akien-mga akien-mga changed the title [graph editors] Keep port icons crisp at high zoom levels and remove artifacts [Graph editors] Keep port icons crisp at high zoom levels and remove artifacts Jul 10, 2023
editor/editor_themes.cpp Outdated Show resolved Hide resolved
@YuriSizov YuriSizov modified the milestones: 4.x, 4.2 Jul 10, 2023
Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an interesting trick. I wonder if we can utilize it elsewhere.

@YuriSizov YuriSizov changed the title [Graph editors] Keep port icons crisp at high zoom levels and remove artifacts Keep GraphNode port icons crisp at high zoom levels and remove artifacts Jul 10, 2023
@YuriSizov YuriSizov merged commit 19f3303 into godotengine:master Jul 12, 2023
@YuriSizov
Copy link
Contributor

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants