diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-01-20 08:00:28 +0100 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-01-20 08:00:28 +0100 |
commit | f2a397375ee46be5725e2e535d3f11a99530f937 (patch) | |
tree | c0c3aaa3c3f9a05fdd23a86177913f54118ce7ef /scene/gui/graph_node.cpp | |
parent | f3f74cf9ae6b4eb2d474208e220a83f8b1e661ab (diff) | |
parent | 76ee2035b6726dbe9f2dc356e71069ff7b6c9d78 (diff) |
Merge pull request #3381 from MarianoGnu/graph_zoom
Add zoom to GraphEdit
Diffstat (limited to 'scene/gui/graph_node.cpp')
-rw-r--r-- | scene/gui/graph_node.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index 5efc9757b7..762afb158a 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -474,7 +474,10 @@ Vector2 GraphNode::get_connection_input_pos(int p_idx) { _connpos_update(); ERR_FAIL_INDEX_V(p_idx,conn_input_cache.size(),Vector2()); - return conn_input_cache[p_idx].pos; + Vector2 pos = conn_input_cache[p_idx].pos; + pos.x *= get_scale().x; + pos.y *= get_scale().y; + return pos; } int GraphNode::get_connection_input_type(int p_idx) { @@ -501,8 +504,10 @@ Vector2 GraphNode::get_connection_output_pos(int p_idx){ _connpos_update(); ERR_FAIL_INDEX_V(p_idx,conn_output_cache.size(),Vector2()); - return conn_output_cache[p_idx].pos; - + Vector2 pos = conn_output_cache[p_idx].pos; + pos.x *= get_scale().x; + pos.y *= get_scale().y; + return pos; } int GraphNode::get_connection_output_type(int p_idx) { |