Skip to content

Commit

Permalink
Merge pull request #79262 from Geometror/vs-port-icon-size-override
Browse files Browse the repository at this point in the history
Keep `GraphNode` port icons crisp at high zoom levels and remove artifacts
  • Loading branch information
YuriSizov committed Jul 12, 2023
2 parents bec5650 + 1bea64a commit 19f3303
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion editor/editor_themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,10 @@ Ref<Theme> create_editor_theme(const Ref<Theme> 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<ImageTexture> 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")));

Expand Down
2 changes: 1 addition & 1 deletion editor/icons/GuiGraphNodePort.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 19f3303

Please sign in to comment.