diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/color_picker.cpp | 10 | ||||
-rw-r--r-- | scene/gui/graph_edit.cpp | 12 |
2 files changed, 15 insertions, 7 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 58a0762469..b197971b61 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -173,7 +173,7 @@ void ColorPicker::_value_changed(double) { color.set_hsv(scroll[0]->get_value() / 360.0, scroll[1]->get_value() / 100.0, scroll[2]->get_value() / 100.0, - scroll[3]->get_value() / 100.0); + scroll[3]->get_value() / 255.0); } else { for (int i = 0; i < 4; i++) { color.components[i] = scroll[i]->get_value() / (raw_mode_enabled ? 1.0 : 255.0); @@ -209,17 +209,17 @@ void ColorPicker::_update_color(bool p_update_sliders) { if (hsv_mode_enabled) { for (int i = 0; i < 4; i++) { - scroll[i]->set_step(0.1); + scroll[i]->set_step(1.0); } - scroll[0]->set_max(360); + scroll[0]->set_max(359); scroll[0]->set_value(h * 360.0); scroll[1]->set_max(100); scroll[1]->set_value(s * 100.0); scroll[2]->set_max(100); scroll[2]->set_value(v * 100.0); - scroll[3]->set_max(100); - scroll[3]->set_value(color.components[3] * 100.0); + scroll[3]->set_max(255); + scroll[3]->set_value(color.components[3] * 255.0); } else { for (int i = 0; i < 4; i++) { if (raw_mode_enabled) { diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index dabff08fea..f238aeb392 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -479,7 +479,7 @@ void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) { connecting_color = gn->get_connection_input_color(j); connecting_target = false; connecting_to = pos; - just_disconnected = true; + just_disconnected = false; return; } @@ -550,11 +550,18 @@ void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) { emit_signal("connection_request", from, from_slot, to, to_slot); } else if (!just_disconnected) { + String from = connecting_from; int from_slot = connecting_index; Vector2 ofs = Vector2(mb->get_position().x, mb->get_position().y); - emit_signal("connection_to_empty", from, from_slot, ofs); + + if (!connecting_out) { + emit_signal("connection_from_empty", from, from_slot, ofs); + } else { + emit_signal("connection_to_empty", from, from_slot, ofs); + } } + connecting = false; top_layer->update(); update(); @@ -1292,6 +1299,7 @@ void GraphEdit::_bind_methods() { ADD_SIGNAL(MethodInfo("duplicate_nodes_request")); ADD_SIGNAL(MethodInfo("node_selected", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Node"))); ADD_SIGNAL(MethodInfo("connection_to_empty", PropertyInfo(Variant::STRING, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::VECTOR2, "release_position"))); + ADD_SIGNAL(MethodInfo("connection_from_empty", PropertyInfo(Variant::STRING, "to"), PropertyInfo(Variant::INT, "to_slot"), PropertyInfo(Variant::VECTOR2, "release_position"))); ADD_SIGNAL(MethodInfo("delete_nodes_request")); ADD_SIGNAL(MethodInfo("_begin_node_move")); ADD_SIGNAL(MethodInfo("_end_node_move")); |