From 3949a93acaeb1da3857048cf3f1b80c0f51b849a Mon Sep 17 00:00:00 2001 From: nertsal Date: Sun, 20 Oct 2024 18:49:34 +0300 Subject: [PATCH] [editor] more intuitive insert starting waypoint --- src/editor/action/level.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/editor/action/level.rs b/src/editor/action/level.rs index 6fc95c0a..ce322b00 100644 --- a/src/editor/action/level.rs +++ b/src/editor/action/level.rs @@ -495,18 +495,23 @@ impl LevelEditor { rotation: self.place_rotation, scale: self.place_scale, }; + let mut interpolation = MoveInterpolation::default(); // TODO: use the same as other waypoints + let mut change_curve = None; match i.checked_sub(1) { None => { // Replace initial std::mem::swap(&mut light.light.movement.initial, &mut transform); + std::mem::swap(&mut light.light.movement.interpolation, &mut interpolation); + change_curve = Some(light.light.movement.curve); + light.light.movement.curve = TrajectoryInterpolation::default(); // Extra time for fade in and telegraph let time = self.current_beat - light.light.movement.fade_in - light.telegraph.precede_time; light.light.movement.key_frames.push_front(MoveFrame { lerp_time: event.beat - time, - interpolation: MoveInterpolation::default(), // TODO: use the same as other waypoints - change_curve: None, + interpolation, + change_curve, transform, }); event.beat = time; @@ -522,8 +527,8 @@ impl LevelEditor { i, MoveFrame { lerp_time, - interpolation: MoveInterpolation::default(), // TODO: use the same as other waypoints - change_curve: None, + interpolation, + change_curve, transform, }, );