diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2019-04-25 07:48:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-25 07:48:59 +0300 |
commit | 9f3899b20a78c0fbd6f69f0c1d76ed1fff6eb3d0 (patch) | |
tree | 2a5ff7202747844d9b5ebb0f71c376b725b69491 /editor/plugins | |
parent | e9be53acd73f63f8dddc829bb8f34b2afd6c7041 (diff) | |
parent | 446f8a2cc20342dfca5f422453715caa15d71c20 (diff) |
Merge pull request #28411 from Chaosus/fix_vs_crash
Fix crash regression in visual shader
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index a732231e17..e91b83bcd8 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -510,18 +510,6 @@ void VisualShaderEditor::_update_graph() { node->add_child(hb); node->set_slot(i + port_offset, valid_left, port_left, type_color[port_left], valid_right, port_right, type_color[port_right]); - - if (EditorSettings::get_singleton()->get("interface/theme/use_graph_node_headers")) { - Ref<StyleBoxFlat> sb = node->get_stylebox("frame", "GraphNode"); - Color c = sb->get_border_color(); - Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0) : Color(0.0, 0.0, 0.0); - mono_color.a = 0.85; - c = mono_color; - - node->add_color_override("title_color", c); - c.a = 0.7; - node->add_color_override("close_color", c); - } } if (vsnode->get_output_port_for_preview() >= 0 && vsnode->get_output_port_type(vsnode->get_output_port_for_preview()) != VisualShaderNode::PORT_TYPE_TRANSFORM) { @@ -542,6 +530,18 @@ void VisualShaderEditor::_update_graph() { if (!uniform.is_valid()) { graph->add_child(node); } + + if (EditorSettings::get_singleton()->get("interface/theme/use_graph_node_headers")) { + Ref<StyleBoxFlat> sb = node->get_stylebox("frame", "GraphNode"); + Color c = sb->get_border_color(); + Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0) : Color(0.0, 0.0, 0.0); + mono_color.a = 0.85; + c = mono_color; + + node->add_color_override("title_color", c); + c.a = 0.7; + node->add_color_override("close_color", c); + } } for (List<VisualShader::Connection>::Element *E = connections.front(); E; E = E->next()) { |