Skip to content

Commit

Permalink
Move cull minor moves to edit menu
Browse files Browse the repository at this point in the history
  • Loading branch information
addiswebb committed Jul 29, 2024
1 parent e8f8955 commit 930f1fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,9 @@ impl eframe::App for App {
}

ui.separator();
if ui.add_enabled(!self.sequencer.keyframes.is_empty(),egui::Button::new("Cull Minor Moves")).on_hover_text("Remove all unnecessary mouse move keyframes").clicked(){
self.sequencer.cull_minor_movement_keyframes();
}
self.sequencer.context_menu(ui, None);
ui.separator();
ui.menu_button("Add", |ui| {
Expand Down
3 changes: 2 additions & 1 deletion src/sequencer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,7 @@ impl Sequencer {
self.mouse_pos.lock().unwrap()
));
ui.checkbox(&mut self.clear_before_recording, "Overwrite Recording");
if ui.button("debug").clicked() {}
});
}
/// Renders the editable data of the selected keyframe
Expand Down Expand Up @@ -1908,7 +1909,7 @@ impl Sequencer {
*last_instant = now;
}
/// Deletes all movement keyframes determined to be redundant.
fn cull_minor_movement_keyframes(&mut self) {
pub fn cull_minor_movement_keyframes(&mut self) {
let mut previous_move_keyframe: Option<usize> = None;
let mut keyframes_to_remove: Vec<usize> = Vec::new();
for i in 0..self.keyframes.len() {
Expand Down

0 comments on commit 930f1fe

Please sign in to comment.