summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/syntax_highlighter.cpp4
-rw-r--r--scene/resources/visual_shader.cpp10
-rw-r--r--scene/resources/visual_shader.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/scene/resources/syntax_highlighter.cpp b/scene/resources/syntax_highlighter.cpp
index 9c8f9334a9..4479b822c0 100644
--- a/scene/resources/syntax_highlighter.cpp
+++ b/scene/resources/syntax_highlighter.cpp
@@ -158,6 +158,10 @@ Dictionary CodeHighlighter::_get_line_syntax_highlighting(int p_line) {
const String &str = text_edit->get_line(p_line);
const int line_length = str.length();
Color prev_color;
+
+ if (in_region != -1 && str.length() == 0) {
+ color_region_cache[p_line] = in_region;
+ }
for (int j = 0; j < line_length; j++) {
Dictionary highlighter_info;
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp
index 8b84ce9e8c..e4851ad9f7 100644
--- a/scene/resources/visual_shader.cpp
+++ b/scene/resources/visual_shader.cpp
@@ -71,7 +71,15 @@ bool VisualShaderNode::is_output_port_connected(int p_port) const {
}
void VisualShaderNode::set_output_port_connected(int p_port, bool p_connected) {
- connected_output_ports[p_port] = p_connected;
+ if (p_connected) {
+ connected_output_ports[p_port] = true;
+ ++connected_output_count;
+ } else {
+ --connected_output_count;
+ if (connected_output_count == 0) {
+ connected_output_ports[p_port] = false;
+ }
+ }
}
bool VisualShaderNode::is_input_port_connected(int p_port) const {
diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h
index d74269cfc6..05d8950be9 100644
--- a/scene/resources/visual_shader.h
+++ b/scene/resources/visual_shader.h
@@ -184,6 +184,7 @@ class VisualShaderNode : public Resource {
Map<int, Variant> default_input_values;
Map<int, bool> connected_input_ports;
Map<int, bool> connected_output_ports;
+ int connected_output_count = 0;
protected:
bool simple_decl;