From 2a52e1fc2cc0fbb0281abd0b53164dc9a7089a66 Mon Sep 17 00:00:00 2001
From: Chittesh Thavamani <tchittesh@gmail.com>
Date: Fri, 23 Apr 2021 23:05:14 -0400
Subject: [PATCH] add move keyframe left/right buttons

---
 src/gui/animate.cpp | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/src/gui/animate.cpp b/src/gui/animate.cpp
index 192bba5..efe2462 100644
--- a/src/gui/animate.cpp
+++ b/src/gui/animate.cpp
@@ -472,6 +472,36 @@ void Animate::timeline(Manager& manager, Undo& undo, Scene& scene, Scene_Maybe o
         undo.bundle_last(undo.n_actions() - n);
     }
 
+    ImGui::SameLine();
+    if(ImGui::Button("Move Left") && current_frame > 0) {
+        if(camera_selected) {
+            undo.anim_clear_camera(anim_camera, (float)current_frame);
+            current_frame--;
+            undo.anim_camera(anim_camera, (float)current_frame, ui_camera.get());
+            camera_spline();
+        } else if(select) {
+            clear_item(*select);
+            current_frame--;
+            set_item(*select);
+        }
+        frame_changed = true;
+    }
+
+    ImGui::SameLine();
+    if(ImGui::Button("Move Right") && current_frame < max_frame-1) {
+        if(camera_selected) {
+            undo.anim_clear_camera(anim_camera, (float)current_frame);
+            current_frame++;
+            undo.anim_camera(anim_camera, (float)current_frame, ui_camera.get());
+            camera_spline();
+        } else if(select) {
+            clear_item(*select);
+            current_frame++;
+            set_item(*select);
+        }
+        frame_changed = true;
+    }
+
     ImGui::Separator();
     ImGui::Dummy({74.0f, 1.0f});
     ImGui::SameLine();
-- 
GitLab