From 1bea64a29512a101c229ec3756b8d346f388ca84 Mon Sep 17 00:00:00 2001 From: Hendrik Brucker Date: Mon, 10 Jul 2023 15:09:40 +0200 Subject: [PATCH] [Graph editors] Keep port icons crisp at high zoom levels, remove rim artifacts --- editor/editor_themes.cpp | 5 ++++- editor/icons/GuiGraphNodePort.svg | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 2ff53dd9f12..4b99a932ad4 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1910,7 +1910,10 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_icon("close", "GraphNode", theme->get_icon(SNAME("GuiCloseCustomizable"), SNAME("EditorIcons"))); theme->set_icon("resizer", "GraphNode", theme->get_icon(SNAME("GuiResizer"), SNAME("EditorIcons"))); - theme->set_icon("port", "GraphNode", theme->get_icon(SNAME("GuiGraphNodePort"), SNAME("EditorIcons"))); + Ref port_icon = theme->get_icon(SNAME("GuiGraphNodePort"), SNAME("EditorIcons")); + // The true size is 24x24 This is necessary for sharp port icons at high zoom levels in GraphEdit (up to ~200%). + port_icon->set_size_override(Size2(12, 12)); + theme->set_icon("port", "GraphNode", port_icon); theme->set_font("title_font", "GraphNode", theme->get_font(SNAME("main_bold_msdf"), SNAME("EditorFonts"))); diff --git a/editor/icons/GuiGraphNodePort.svg b/editor/icons/GuiGraphNodePort.svg index d04dabcfc31..04645d97b70 100644 --- a/editor/icons/GuiGraphNodePort.svg +++ b/editor/icons/GuiGraphNodePort.svg @@ -1 +1 @@ - +