summaryrefslogtreecommitdiffstats
path: root/editor/animation_track_editor.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-01-08 11:50:38 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-01-08 11:50:38 +0100
commita2bd7c3301360945abb4b9b62182e2ba809b10d5 (patch)
treeae5797b7a7ae66096d1dfea401fcfa6db8a11f3e /editor/animation_track_editor.h
parent774c4631fd316cb51eb45c6972bfd54633ed86f9 (diff)
parent5b3d5e0a65f3eb6fd4282cd1e5f24410f3c37a5f (diff)
downloadredot-engine-a2bd7c3301360945abb4b9b62182e2ba809b10d5.tar.gz
Merge pull request #85142 from CookieBadger/animation-player-improvements
Improve usability of zooming in the animation editor
Diffstat (limited to 'editor/animation_track_editor.h')
-rw-r--r--editor/animation_track_editor.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h
index 0667b8e80e..b5242e2f67 100644
--- a/editor/animation_track_editor.h
+++ b/editor/animation_track_editor.h
@@ -131,6 +131,11 @@ protected:
class AnimationTimelineEdit : public Range {
GDCLASS(AnimationTimelineEdit, Range);
+ friend class AnimationBezierTrackEdit;
+ friend class AnimationTrackEditor;
+
+ static constexpr float SCROLL_ZOOM_FACTOR = 1.02f; // Zoom factor per mouse scroll in the animation editor. The closer to 1.0, the finer the control.
+
Ref<Animation> animation;
bool read_only = false;
@@ -167,6 +172,11 @@ class AnimationTimelineEdit : public Range {
bool dragging_hsize = false;
float dragging_hsize_from = 0.0f;
float dragging_hsize_at = 0.0f;
+ double last_zoom_scale = 1.0;
+ double hscroll_on_zoom_buffer = -1.0;
+
+ Vector2 zoom_scroll_origin;
+ bool zoom_callback_occured = false;
virtual void gui_input(const Ref<InputEvent> &p_event) override;
void _track_added(int p_track);