mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-23 17:47:17 +01:00
Fix GraphEdit's valid connections being reversed
(cherry picked from commit b29aff8dac9bf342e45e6b6332b5efa13af9fa26)
This commit is contained in:
parent
0658cad124
commit
0da6b17950
@ -678,7 +678,7 @@ void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) {
|
||||
for (int j = 0; j < gn->get_connection_output_count(); j++) {
|
||||
Vector2 pos = gn->get_connection_output_position(j) + gn->get_position();
|
||||
int type = gn->get_connection_output_type(j);
|
||||
if ((type == connecting_type || valid_connection_types.has(ConnType(type, connecting_type))) && is_in_hot_zone(pos / zoom, mpos, port_size, false)) {
|
||||
if ((type == connecting_type || valid_connection_types.has(ConnType(connecting_type, type))) && is_in_hot_zone(pos / zoom, mpos, port_size, false)) {
|
||||
connecting_target = true;
|
||||
connecting_to = pos;
|
||||
connecting_target_to = gn->get_name();
|
||||
@ -690,7 +690,7 @@ void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) {
|
||||
for (int j = 0; j < gn->get_connection_input_count(); j++) {
|
||||
Vector2 pos = gn->get_connection_input_position(j) + gn->get_position();
|
||||
int type = gn->get_connection_input_type(j);
|
||||
if ((type == connecting_type || valid_connection_types.has(ConnType(type, connecting_type))) && is_in_hot_zone(pos / zoom, mpos, port_size, true)) {
|
||||
if ((type == connecting_type || valid_connection_types.has(ConnType(connecting_type, type))) && is_in_hot_zone(pos / zoom, mpos, port_size, true)) {
|
||||
connecting_target = true;
|
||||
connecting_to = pos;
|
||||
connecting_target_to = gn->get_name();
|
||||
@ -1565,26 +1565,17 @@ void GraphEdit::_update_zoom_label() {
|
||||
}
|
||||
|
||||
void GraphEdit::add_valid_connection_type(int p_type, int p_with_type) {
|
||||
ConnType ct;
|
||||
ct.type_a = p_type;
|
||||
ct.type_b = p_with_type;
|
||||
|
||||
ConnType ct(p_type, p_with_type);
|
||||
valid_connection_types.insert(ct);
|
||||
}
|
||||
|
||||
void GraphEdit::remove_valid_connection_type(int p_type, int p_with_type) {
|
||||
ConnType ct;
|
||||
ct.type_a = p_type;
|
||||
ct.type_b = p_with_type;
|
||||
|
||||
ConnType ct(p_type, p_with_type);
|
||||
valid_connection_types.erase(ct);
|
||||
}
|
||||
|
||||
bool GraphEdit::is_valid_connection_type(int p_type, int p_with_type) const {
|
||||
ConnType ct;
|
||||
ct.type_a = p_type;
|
||||
ct.type_b = p_with_type;
|
||||
|
||||
ConnType ct(p_type, p_with_type);
|
||||
return valid_connection_types.has(ct);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user