Merge pull request #42467 from Chaosus/vs_fix_bug
Updates size of float constant in visual shader if empty is selected
This commit is contained in:
commit
17d588f7b3
@ -226,6 +226,13 @@ void VisualShaderGraphPlugin::update_constant(VisualShader::Type p_type, int p_n
|
|||||||
links[p_node_id].graph_node->set_size(Size2(-1, -1));
|
links[p_node_id].graph_node->set_size(Size2(-1, -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VisualShaderGraphPlugin::update_node_size(int p_node_id) {
|
||||||
|
if (!links.has(p_node_id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
links[p_node_id].graph_node->set_size(Size2(-1, -1));
|
||||||
|
}
|
||||||
|
|
||||||
void VisualShaderGraphPlugin::register_default_input_button(int p_node_id, int p_port_id, Button *p_button) {
|
void VisualShaderGraphPlugin::register_default_input_button(int p_node_id, int p_port_id, Button *p_button) {
|
||||||
links[p_node_id].input_ports.insert(p_port_id, { p_button });
|
links[p_node_id].input_ports.insert(p_port_id, { p_button });
|
||||||
}
|
}
|
||||||
@ -2516,6 +2523,7 @@ void VisualShaderEditor::_uniform_select_item(Ref<VisualShaderNodeUniformRef> p_
|
|||||||
|
|
||||||
void VisualShaderEditor::_float_constant_selected(int p_index, int p_node) {
|
void VisualShaderEditor::_float_constant_selected(int p_index, int p_node) {
|
||||||
if (p_index == 0) {
|
if (p_index == 0) {
|
||||||
|
graph_plugin->update_node_size(p_node);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +111,7 @@ public:
|
|||||||
void set_uniform_name(VisualShader::Type p_type, int p_node_id, const String &p_name);
|
void set_uniform_name(VisualShader::Type p_type, int p_node_id, const String &p_name);
|
||||||
void update_constant(VisualShader::Type p_type, int p_node_id);
|
void update_constant(VisualShader::Type p_type, int p_node_id);
|
||||||
int get_constant_index(float p_constant) const;
|
int get_constant_index(float p_constant) const;
|
||||||
|
void update_node_size(int p_node_id);
|
||||||
VisualShader::Type get_shader_type() const;
|
VisualShader::Type get_shader_type() const;
|
||||||
|
|
||||||
VisualShaderGraphPlugin();
|
VisualShaderGraphPlugin();
|
||||||
|
Loading…
Reference in New Issue
Block a user