diff options
Diffstat (limited to 'editor/animation_bezier_editor.h')
-rw-r--r-- | editor/animation_bezier_editor.h | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/editor/animation_bezier_editor.h b/editor/animation_bezier_editor.h index 578c6f9337..6a5b97a7da 100644 --- a/editor/animation_bezier_editor.h +++ b/editor/animation_bezier_editor.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,24 +33,19 @@ #include "animation_track_editor.h" +class ViewPanner; + class AnimationBezierTrackEdit : public Control { GDCLASS(AnimationBezierTrackEdit, Control); - enum HandleMode { - HANDLE_MODE_FREE, - HANDLE_MODE_BALANCED, - HANDLE_MODE_MIRROR - }; - enum { MENU_KEY_INSERT, MENU_KEY_DUPLICATE, - MENU_KEY_DELETE + MENU_KEY_DELETE, + MENU_KEY_SET_HANDLE_FREE, + MENU_KEY_SET_HANDLE_BALANCED, }; - HandleMode handle_mode; - OptionButton *handle_mode_option; - VBoxContainer *right_column; Button *close_button; @@ -69,8 +64,6 @@ class AnimationBezierTrackEdit : public Control { Ref<Texture2D> bezier_handle_icon; Ref<Texture2D> selected_icon; - Rect2 close_icon_rect; - Map<int, Rect2> subtracks; float v_scroll = 0; @@ -104,10 +97,12 @@ class AnimationBezierTrackEdit : public Control { int moving_handle_key = 0; Vector2 moving_handle_left; Vector2 moving_handle_right; + int moving_handle_mode; // value from Animation::HandleMode void _clear_selection(); void _clear_selection_for_anim(const Ref<Animation> &p_anim); void _select_at_anim(const Ref<Animation> &p_anim, int p_track, float p_pos); + void _change_selected_keys_handle_mode(Animation::HandleMode p_mode); Vector2 menu_insert_key; @@ -130,9 +125,10 @@ class AnimationBezierTrackEdit : public Control { Set<int> selection; - bool panning_timeline = false; - float panning_timeline_from; - float panning_timeline_at; + Ref<ViewPanner> panner; + void _scroll_callback(Vector2 p_scroll_vec); + void _pan_callback(Vector2 p_scroll_vec); + void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin); void _draw_line_clipped(const Vector2 &p_from, const Vector2 &p_to, const Color &p_color, int p_clip_left, int p_clip_right); void _draw_track(int p_track, const Color &p_color); |