Implement time module for wasm-bindgen backend in iced_futures
This commit is contained in:
parent
167be45a7d
commit
e730d97f61
7 changed files with 61 additions and 21 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue