low polling rate edge case
This commit is contained in:
parent
d393f9f187
commit
fea5bf4398
@ -90,8 +90,17 @@ impl MouseInterpolator{
|
|||||||
let buffer_state=core::mem::replace(&mut self.buffer_state,BufferState::Unbuffered);
|
let buffer_state=core::mem::replace(&mut self.buffer_state,BufferState::Unbuffered);
|
||||||
match buffer_state{
|
match buffer_state{
|
||||||
BufferState::Unbuffered=>(),
|
BufferState::Unbuffered=>(),
|
||||||
BufferState::Initializing(_time,mouse_state)
|
BufferState::Initializing(_time,mouse_state)=>{
|
||||||
|BufferState::Buffered(_time,mouse_state)=>{
|
// only a single mouse move was sent in 10ms, this is very much an edge case!
|
||||||
|
self.push_mouse_and_flush_buffer(TimedInstruction{
|
||||||
|
time:mouse_state.time,
|
||||||
|
instruction:MouseInstruction::ReplaceMouse{
|
||||||
|
m1:MouseState{pos:mouse_state.pos,time},
|
||||||
|
m0:mouse_state,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
BufferState::Buffered(_time,mouse_state)=>{
|
||||||
// convert to BufferState::Unbuffered
|
// convert to BufferState::Unbuffered
|
||||||
// use the first instruction which should be a mouse instruction
|
// use the first instruction which should be a mouse instruction
|
||||||
// to push a ReplaceMouse instruction
|
// to push a ReplaceMouse instruction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user