diff options
author | kobewi <kobewi4e@gmail.com> | 2022-01-19 19:59:12 +0100 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2022-01-21 18:35:06 +0100 |
commit | 74bfe88267263297b43fef35fd9f32a91750d4d2 (patch) | |
tree | 7928ce063d68c991a3a25cb1aae87683b8ded789 /modules/visual_script/editor | |
parent | 249c60e9d1aacd07d87786db8059f30aed02bb68 (diff) |
Add ViewPanner to 2D editor
Diffstat (limited to 'modules/visual_script/editor')
-rw-r--r-- | modules/visual_script/editor/visual_script_editor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/visual_script/editor/visual_script_editor.cpp b/modules/visual_script/editor/visual_script_editor.cpp index ec1a8a6b42..5b887a0cde 100644 --- a/modules/visual_script/editor/visual_script_editor.cpp +++ b/modules/visual_script/editor/visual_script_editor.cpp @@ -42,6 +42,7 @@ #include "editor/editor_node.h" #include "editor/editor_resource_preview.h" #include "editor/editor_scale.h" +#include "scene/gui/view_panner.h" #include "scene/main/window.h" #ifdef TOOLS_ENABLED @@ -3782,7 +3783,8 @@ void VisualScriptEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - graph->set_panning_scheme((GraphEdit::PanningScheme)EDITOR_GET("interface/editors/sub_editor_panning_scheme").operator int()); + graph->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editor_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); + graph->set_warped_panning(bool(EditorSettings::get_singleton()->get("editors/panning/warped_mouse_panning"))); } break; case NOTIFICATION_READY: { |