You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Fix Visual Script's jump to function relative to zoom
When double-clicking on a function name the graph will now correctly jump to the function relative to the zoom ratio.
This commit is contained in:
committed by
Rémi Verschelde
parent
43f94c95aa
commit
e8a326a08f
@@ -2727,7 +2727,7 @@ void VisualScriptEditor::_center_on_node(int p_id) {
|
||||
|
||||
if (gn) {
|
||||
gn->set_selected(true);
|
||||
Vector2 new_scroll = gn->get_position_offset() - graph->get_size() * 0.5 + gn->get_size() * 0.5;
|
||||
Vector2 new_scroll = gn->get_position_offset() * graph->get_zoom() - graph->get_size() * 0.5 + gn->get_size() * 0.5;
|
||||
graph->set_scroll_ofs(new_scroll);
|
||||
script->set_scroll(new_scroll / EDSCALE);
|
||||
script->set_edited(true);
|
||||
|
||||
Reference in New Issue
Block a user