diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/graph_edit.cpp | 7 | ||||
-rw-r--r-- | scene/gui/graph_edit.h | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index deb3151798..85f00f9d84 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -42,7 +42,6 @@ bool GraphEdit::is_node_connected(const StringName& p_from, int p_from_port,cons void GraphEdit::disconnect_node(const StringName& p_from, int p_from_port,const StringName& p_to,int p_to_port){ - for(List<Connection>::Element *E=connections.front();E;E=E->next()) { if (E->get().from==p_from && E->get().from_port==p_from_port && E->get().to==p_to && E->get().to_port==p_to_port) { @@ -59,9 +58,12 @@ void GraphEdit::get_connection_list(List<Connection> *r_connections) const { *r_connections=connections; } +Vector2 GraphEdit::get_scroll_ofs() const{ -void GraphEdit::_scroll_moved(double) { + return Vector2(h_scroll->get_val(),v_scroll->get_val()); +} +void GraphEdit::_scroll_moved(double) { _update_scroll_offset(); top_layer->update(); @@ -718,6 +720,7 @@ void GraphEdit::_bind_methods() { ObjectTypeDB::bind_method(_MD("is_node_connected","from","from_port","to","to_port"),&GraphEdit::is_node_connected); ObjectTypeDB::bind_method(_MD("disconnect_node","from","from_port","to","to_port"),&GraphEdit::disconnect_node); ObjectTypeDB::bind_method(_MD("get_connection_list"),&GraphEdit::_get_connection_list); + ObjectTypeDB::bind_method(_MD("get_scroll_ofs"),&GraphEdit::get_scroll_ofs); ObjectTypeDB::bind_method(_MD("set_right_disconnects","enable"),&GraphEdit::set_right_disconnects); ObjectTypeDB::bind_method(_MD("is_right_disconnects_enabled"),&GraphEdit::is_right_disconnects_enabled); diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h index 44f5a369c2..5e339e4e7e 100644 --- a/scene/gui/graph_edit.h +++ b/scene/gui/graph_edit.h @@ -101,6 +101,8 @@ public: void set_right_disconnects(bool p_enable); bool is_right_disconnects_enabled() const; + + Vector2 get_scroll_ofs() const; GraphEdit(); |