diff options
Diffstat (limited to 'native')
-rw-r--r-- | native/src/mouse/click.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/native/src/mouse/click.rs b/native/src/mouse/click.rs index ec321387..4a7d796c 100644 --- a/native/src/mouse/click.rs +++ b/native/src/mouse/click.rs @@ -62,9 +62,14 @@ impl Click { } fn is_consecutive(&self, new_position: Point, time: Instant) -> bool { + let duration = if time > self.time { + Some(time - self.time) + } else { + None + }; + self.position == new_position - && time - .checked_duration_since(self.time) + && duration .map(|duration| duration.as_millis() <= 300) .unwrap_or(false) } |