From baf560ffee1dc0cfd676a7424ff098d45e8059ef Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 20 Jul 2023 07:32:39 +0400 Subject: [PATCH] editor: Fix adjustment active checks on mouse down --- src/modules/tas_studio/editor/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/tas_studio/editor/mod.rs b/src/modules/tas_studio/editor/mod.rs index 6d65c50..b001942 100644 --- a/src/modules/tas_studio/editor/mod.rs +++ b/src/modules/tas_studio/editor/mod.rs @@ -862,9 +862,10 @@ impl Editor { // Only update the selected bulk and start the adjustments if the mouse has just been // pressed. - if mouse_became_down { + if mouse_became_down && !self.in_camera_editor { // Since all mouse buttons that start adjustments have been down last frame, there - // cannot be any active adjustments now. + // cannot be any active adjustments now. All movement editor adjustments are + // triggered by the mouse only. assert!(!self.is_any_adjustment_active()); // Make the hovered bulk the selected bulk (or clear the selected bulk if not @@ -1131,8 +1132,13 @@ impl Editor { if self.in_camera_editor { if let Some(hovered_frame_idx) = self.hovered_frame_idx { if keyboard.insert_camera_line && !self.prev_keyboard_state.insert_camera_line { + // Keyboard was released last frame so the adjustment cannot be active. assert!(self.insert_camera_line_adjustment.is_none()); + // There are no other adjustments in the camera editor at the moment; and anyhow + // when more are added, this condition should still be upheld. + assert!(!self.is_any_adjustment_active()); + let branch = self.branch_mut(); let frame = &branch.frames[hovered_frame_idx];