Minor tweaks and fixes to panning
This commit is contained in:
parent
c3d28ffa74
commit
98692d68c3
19 changed files with 47 additions and 49 deletions
|
@ -218,7 +218,7 @@ void AnimationBezierTrackEdit::_draw_line_clipped(const Vector2 &p_from, const V
|
|||
|
||||
void AnimationBezierTrackEdit::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("interface/editors/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
}
|
||||
if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) {
|
||||
close_button->set_icon(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
|
@ -994,7 +994,7 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
|
|||
}
|
||||
}
|
||||
|
||||
void AnimationBezierTrackEdit::_scroll_callback(Vector2 p_scroll_vec) {
|
||||
void AnimationBezierTrackEdit::_scroll_callback(Vector2 p_scroll_vec, bool p_alt) {
|
||||
_pan_callback(-p_scroll_vec * 32);
|
||||
}
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ class AnimationBezierTrackEdit : public Control {
|
|||
Set<int> selection;
|
||||
|
||||
Ref<ViewPanner> panner;
|
||||
void _scroll_callback(Vector2 p_scroll_vec);
|
||||
void _scroll_callback(Vector2 p_scroll_vec, bool p_alt);
|
||||
void _pan_callback(Vector2 p_scroll_vec);
|
||||
void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt);
|
||||
|
||||
|
|
|
@ -1459,7 +1459,7 @@ int AnimationTimelineEdit::get_name_limit() const {
|
|||
|
||||
void AnimationTimelineEdit::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("interface/editors/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||
|
@ -1799,7 +1799,7 @@ void AnimationTimelineEdit::gui_input(const Ref<InputEvent> &p_event) {
|
|||
int x = mb->get_position().x - get_name_limit();
|
||||
|
||||
float ofs = x / get_zoom_scale() + get_value();
|
||||
emit_signal(SNAME("timeline_changed"), ofs, false, Input::get_singleton()->is_key_pressed(Key::ALT));
|
||||
emit_signal(SNAME("timeline_changed"), ofs, false, mb->is_alt_pressed());
|
||||
dragging_timeline = true;
|
||||
}
|
||||
}
|
||||
|
@ -1833,7 +1833,7 @@ void AnimationTimelineEdit::gui_input(const Ref<InputEvent> &p_event) {
|
|||
}
|
||||
}
|
||||
|
||||
void AnimationTimelineEdit::_scroll_callback(Vector2 p_scroll_vec) {
|
||||
void AnimationTimelineEdit::_scroll_callback(Vector2 p_scroll_vec, bool p_alt) {
|
||||
// Timeline has no vertical scroll, so we change it to horizontal.
|
||||
p_scroll_vec.x += p_scroll_vec.y;
|
||||
_pan_callback(-p_scroll_vec * 32);
|
||||
|
@ -1872,7 +1872,7 @@ void AnimationTimelineEdit::_track_added(int p_track) {
|
|||
void AnimationTimelineEdit::_bind_methods() {
|
||||
ADD_SIGNAL(MethodInfo("zoom_changed"));
|
||||
ADD_SIGNAL(MethodInfo("name_limit_changed"));
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"), PropertyInfo(Variant::BOOL, "timeline_only")));
|
||||
ADD_SIGNAL(MethodInfo("track_added", PropertyInfo(Variant::INT, "track")));
|
||||
ADD_SIGNAL(MethodInfo("length_changed", PropertyInfo(Variant::FLOAT, "size")));
|
||||
}
|
||||
|
@ -3121,7 +3121,7 @@ void AnimationTrackEdit::append_to_selection(const Rect2 &p_box, bool p_deselect
|
|||
}
|
||||
|
||||
void AnimationTrackEdit::_bind_methods() {
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"), PropertyInfo(Variant::BOOL, "timeline_only")));
|
||||
ADD_SIGNAL(MethodInfo("remove_request", PropertyInfo(Variant::INT, "track")));
|
||||
ADD_SIGNAL(MethodInfo("dropped", PropertyInfo(Variant::INT, "from_track"), PropertyInfo(Variant::INT, "to_track")));
|
||||
ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::FLOAT, "ofs")));
|
||||
|
@ -3648,7 +3648,7 @@ void AnimationTrackEditor::_insert_track(bool p_create_reset, bool p_create_bezi
|
|||
pos = animation->get_length();
|
||||
}
|
||||
set_anim_pos(pos);
|
||||
emit_signal(SNAME("timeline_changed"), pos, true);
|
||||
emit_signal(SNAME("timeline_changed"), pos, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4510,7 +4510,7 @@ MenuButton *AnimationTrackEditor::get_edit_menu() {
|
|||
|
||||
void AnimationTrackEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("interface/editors/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) {
|
||||
|
@ -5230,16 +5230,6 @@ void AnimationTrackEditor::_scroll_input(const Ref<InputEvent> &p_event) {
|
|||
|
||||
Ref<InputEventMouseButton> mb = p_event;
|
||||
|
||||
if (mb.is_valid() && mb->is_pressed() && mb->is_alt_pressed() && mb->get_button_index() == MouseButton::WHEEL_UP) {
|
||||
goto_prev_step(true);
|
||||
scroll->accept_event();
|
||||
}
|
||||
|
||||
if (mb.is_valid() && mb->is_pressed() && mb->is_alt_pressed() && mb->get_button_index() == MouseButton::WHEEL_DOWN) {
|
||||
goto_next_step(true);
|
||||
scroll->accept_event();
|
||||
}
|
||||
|
||||
if (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT) {
|
||||
if (mb->is_pressed()) {
|
||||
box_selecting = true;
|
||||
|
@ -5304,8 +5294,16 @@ void AnimationTrackEditor::_scroll_input(const Ref<InputEvent> &p_event) {
|
|||
}
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_scroll_callback(Vector2 p_scroll_vec) {
|
||||
_pan_callback(-p_scroll_vec * 32);
|
||||
void AnimationTrackEditor::_scroll_callback(Vector2 p_scroll_vec, bool p_alt) {
|
||||
if (p_alt) {
|
||||
if (p_scroll_vec.x < 0 || p_scroll_vec.y < 0) {
|
||||
goto_prev_step(true);
|
||||
} else {
|
||||
goto_next_step(true);
|
||||
}
|
||||
} else {
|
||||
_pan_callback(-p_scroll_vec * 32);
|
||||
}
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_pan_callback(Vector2 p_scroll_vec) {
|
||||
|
@ -5447,7 +5445,7 @@ void AnimationTrackEditor::goto_prev_step(bool p_from_mouse_event) {
|
|||
pos = 0;
|
||||
}
|
||||
set_anim_pos(pos);
|
||||
emit_signal(SNAME("timeline_changed"), pos, true);
|
||||
emit_signal(SNAME("timeline_changed"), pos, true, false);
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::goto_next_step(bool p_from_mouse_event) {
|
||||
|
@ -5474,7 +5472,7 @@ void AnimationTrackEditor::goto_next_step(bool p_from_mouse_event) {
|
|||
}
|
||||
set_anim_pos(pos);
|
||||
|
||||
emit_signal(SNAME("timeline_changed"), pos, true);
|
||||
emit_signal(SNAME("timeline_changed"), pos, true, false);
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
|
||||
|
@ -5998,7 +5996,7 @@ void AnimationTrackEditor::_bind_methods() {
|
|||
ClassDB::bind_method("_key_deselected", &AnimationTrackEditor::_key_deselected); // Still used by some connect_compat.
|
||||
ClassDB::bind_method("_clear_selection", &AnimationTrackEditor::_clear_selection); // Still used by some connect_compat.
|
||||
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"), PropertyInfo(Variant::BOOL, "timeline_only")));
|
||||
ADD_SIGNAL(MethodInfo("keying_changed"));
|
||||
ADD_SIGNAL(MethodInfo("animation_len_changed", PropertyInfo(Variant::FLOAT, "len")));
|
||||
ADD_SIGNAL(MethodInfo("animation_step_changed", PropertyInfo(Variant::FLOAT, "step")));
|
||||
|
|
|
@ -82,7 +82,7 @@ class AnimationTimelineEdit : public Range {
|
|||
bool use_fps;
|
||||
|
||||
Ref<ViewPanner> panner;
|
||||
void _scroll_callback(Vector2 p_scroll_vec);
|
||||
void _scroll_callback(Vector2 p_scroll_vec, bool p_alt);
|
||||
void _pan_callback(Vector2 p_scroll_vec);
|
||||
void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt);
|
||||
|
||||
|
@ -316,7 +316,7 @@ class AnimationTrackEditor : public VBoxContainer {
|
|||
void _update_tracks();
|
||||
|
||||
void _name_limit_changed();
|
||||
void _timeline_changed(float p_new_pos, bool p_drag, bool p_timeline_only = false);
|
||||
void _timeline_changed(float p_new_pos, bool p_drag, bool p_timeline_only);
|
||||
void _track_remove_request(int p_track);
|
||||
void _track_grab_focus(int p_track);
|
||||
|
||||
|
@ -377,7 +377,7 @@ class AnimationTrackEditor : public VBoxContainer {
|
|||
PropertyInfo _find_hint_for_track(int p_idx, NodePath &r_base_path, Variant *r_current_val = nullptr);
|
||||
|
||||
Ref<ViewPanner> panner;
|
||||
void _scroll_callback(Vector2 p_scroll_vec);
|
||||
void _scroll_callback(Vector2 p_scroll_vec, bool p_alt);
|
||||
void _pan_callback(Vector2 p_scroll_vec);
|
||||
void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt);
|
||||
|
||||
|
|
|
@ -647,7 +647,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
|||
// Panning
|
||||
// Enum should be in sync with ControlScheme in ViewPanner.
|
||||
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/panning/2d_editor_panning_scheme", 0, "Scroll Zooms,Scroll Pans");
|
||||
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/panning/sub_editor_panning_scheme", 0, "Scroll Zooms,Scroll Pans");
|
||||
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/panning/sub_editors_panning_scheme", 0, "Scroll Zooms,Scroll Pans");
|
||||
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/panning/animation_editors_panning_scheme", 1, "Scroll Zooms,Scroll Pans");
|
||||
_initial_set("editors/panning/simple_panning", false);
|
||||
_initial_set("editors/panning/warped_mouse_panning", true);
|
||||
|
|
|
@ -734,7 +734,7 @@ void AnimationNodeBlendTreeEditor::_removed_from_graph() {
|
|||
|
||||
void AnimationNodeBlendTreeEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
||||
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->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_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")));
|
||||
}
|
||||
|
||||
|
|
|
@ -1187,7 +1187,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event, bo
|
|||
return false;
|
||||
}
|
||||
|
||||
void CanvasItemEditor::_scroll_callback(Vector2 p_scroll_vec) {
|
||||
void CanvasItemEditor::_scroll_callback(Vector2 p_scroll_vec, bool p_alt) {
|
||||
_pan_callback(-p_scroll_vec * pan_speed);
|
||||
}
|
||||
|
||||
|
@ -3858,7 +3858,7 @@ void CanvasItemEditor::_notification(int p_what) {
|
|||
|
||||
anchor_mode_button->set_icon(get_theme_icon(SNAME("Anchor"), SNAME("EditorIcons")));
|
||||
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("interface/editors/2d_editor_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/2d_editor_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
pan_speed = int(EditorSettings::get_singleton()->get("editors/panning/2d_editor_pan_speed"));
|
||||
warped_panning = bool(EditorSettings::get_singleton()->get("editors/panning/warped_mouse_panning"));
|
||||
}
|
||||
|
|
|
@ -406,7 +406,7 @@ private:
|
|||
Ref<ViewPanner> panner;
|
||||
bool warped_panning = true;
|
||||
int pan_speed = 20;
|
||||
void _scroll_callback(Vector2 p_scroll_vec);
|
||||
void _scroll_callback(Vector2 p_scroll_vec, bool p_alt);
|
||||
void _pan_callback(Vector2 p_scroll_vec);
|
||||
void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ void Polygon2DEditor::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
uv_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")));
|
||||
uv_panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
} break;
|
||||
case NOTIFICATION_READY: {
|
||||
button_uv->set_icon(get_theme_icon(SNAME("Uv"), SNAME("EditorIcons")));
|
||||
|
@ -926,7 +926,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
|
|||
}
|
||||
}
|
||||
|
||||
void Polygon2DEditor::_uv_scroll_callback(Vector2 p_scroll_vec) {
|
||||
void Polygon2DEditor::_uv_scroll_callback(Vector2 p_scroll_vec, bool p_alt) {
|
||||
_uv_pan_callback(-p_scroll_vec * 32);
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ class Polygon2DEditor : public AbstractPolygon2DEditor {
|
|||
TextureRect *uv_icon_zoom;
|
||||
|
||||
Ref<ViewPanner> uv_panner;
|
||||
void _uv_scroll_callback(Vector2 p_scroll_vec);
|
||||
void _uv_scroll_callback(Vector2 p_scroll_vec, bool p_alt);
|
||||
void _uv_pan_callback(Vector2 p_scroll_vec);
|
||||
void _uv_zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt);
|
||||
|
||||
|
|
|
@ -602,7 +602,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
|
|||
}
|
||||
}
|
||||
|
||||
void TextureRegionEditor::_scroll_callback(Vector2 p_scroll_vec) {
|
||||
void TextureRegionEditor::_scroll_callback(Vector2 p_scroll_vec, bool p_alt) {
|
||||
_pan_callback(-p_scroll_vec * 32);
|
||||
}
|
||||
|
||||
|
@ -820,7 +820,7 @@ void TextureRegionEditor::_notification(int p_what) {
|
|||
[[fallthrough]];
|
||||
}
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
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")));
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
} break;
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
if (snap_mode == SNAP_AUTOSLICE && is_visible() && autoslice_is_dirty) {
|
||||
|
|
|
@ -101,7 +101,7 @@ class TextureRegionEditor : public VBoxContainer {
|
|||
int drag_index;
|
||||
|
||||
Ref<ViewPanner> panner;
|
||||
void _scroll_callback(Vector2 p_scroll_vec);
|
||||
void _scroll_callback(Vector2 p_scroll_vec, bool p_alt);
|
||||
void _pan_callback(Vector2 p_scroll_vec);
|
||||
void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ void TileAtlasView::gui_input(const Ref<InputEvent> &p_event) {
|
|||
}
|
||||
}
|
||||
|
||||
void TileAtlasView::_scroll_callback(Vector2 p_scroll_vec) {
|
||||
void TileAtlasView::_scroll_callback(Vector2 p_scroll_vec, bool p_alt) {
|
||||
_pan_callback(-p_scroll_vec * 32);
|
||||
}
|
||||
|
||||
|
@ -524,7 +524,7 @@ void TileAtlasView::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED:
|
||||
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")));
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
break;
|
||||
|
||||
case NOTIFICATION_READY:
|
||||
|
|
|
@ -67,7 +67,7 @@ private:
|
|||
virtual void gui_input(const Ref<InputEvent> &p_event) override;
|
||||
|
||||
Ref<ViewPanner> panner;
|
||||
void _scroll_callback(Vector2 p_scroll_vec);
|
||||
void _scroll_callback(Vector2 p_scroll_vec, bool p_alt);
|
||||
void _pan_callback(Vector2 p_scroll_vec);
|
||||
void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt);
|
||||
|
||||
|
|
|
@ -3224,7 +3224,7 @@ void VisualShaderEditor::_notification(int p_what) {
|
|||
}
|
||||
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
||||
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->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_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")));
|
||||
}
|
||||
|
||||
|
|
|
@ -3913,7 +3913,7 @@ void VisualScriptEditor::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
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->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_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;
|
||||
|
||||
|
|
|
@ -1356,7 +1356,7 @@ void GraphEdit::gui_input(const Ref<InputEvent> &p_ev) {
|
|||
}
|
||||
}
|
||||
|
||||
void GraphEdit::_scroll_callback(Vector2 p_scroll_vec) {
|
||||
void GraphEdit::_scroll_callback(Vector2 p_scroll_vec, bool p_alt) {
|
||||
if (p_scroll_vec.x != 0) {
|
||||
h_scroll->set_value(h_scroll->get_value() + (h_scroll->get_page() * Math::abs(p_scroll_vec.x) / 8) * SIGN(p_scroll_vec.x));
|
||||
} else {
|
||||
|
|
|
@ -131,7 +131,7 @@ private:
|
|||
|
||||
Ref<ViewPanner> panner;
|
||||
bool warped_panning = true;
|
||||
void _scroll_callback(Vector2 p_scroll_vec);
|
||||
void _scroll_callback(Vector2 p_scroll_vec, bool p_alt);
|
||||
void _pan_callback(Vector2 p_scroll_vec);
|
||||
void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ bool ViewPanner::gui_input(const Ref<InputEvent> &p_event, Rect2 p_canvas_rect)
|
|||
panning.y += mb->get_factor() * scroll_vec.y;
|
||||
panning.x += mb->get_factor() * scroll_vec.x;
|
||||
}
|
||||
callback_helper(scroll_callback, varray(panning));
|
||||
callback_helper(scroll_callback, varray(panning, mb->is_alt_pressed()));
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
|
@ -66,7 +66,7 @@ bool ViewPanner::gui_input(const Ref<InputEvent> &p_event, Rect2 p_canvas_rect)
|
|||
panning.y += mb->get_factor() * scroll_vec.y;
|
||||
panning.x += mb->get_factor() * scroll_vec.x;
|
||||
}
|
||||
callback_helper(scroll_callback, varray(panning));
|
||||
callback_helper(scroll_callback, varray(panning, mb->is_alt_pressed()));
|
||||
return true;
|
||||
} else if (!mb->is_shift_pressed()) {
|
||||
scroll_vec.y *= mb->get_factor();
|
||||
|
@ -76,7 +76,7 @@ bool ViewPanner::gui_input(const Ref<InputEvent> &p_event, Rect2 p_canvas_rect)
|
|||
}
|
||||
}
|
||||
|
||||
// Use Alt only for scrolling.
|
||||
// Alt is not used for button presses, so ignore it.
|
||||
if (mb->is_alt_pressed()) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue