diff --git a/src/physics_worker.rs b/src/physics_worker.rs index e7c278c..7c294ac 100644 --- a/src/physics_worker.rs +++ b/src/physics_worker.rs @@ -37,7 +37,7 @@ impl MouseInterpolator{ let t0=self.queue[0].time; let mut iter=self.queue.iter(); //find a mouse input - let mouse0=None; + let mut mouse0=None; iter.take_while(|&ins|{ match ins.instruction{ InputInstruction::MoveMouse(m)=>{ @@ -50,6 +50,9 @@ impl MouseInterpolator{ }, } }); + if mouse0.is_none(){ + return; + } let mut mouse1=None; for ins in iter{ //fill mouse0