double click fixed

This commit is contained in:
FabianLars 2020-02-24 20:10:20 +01:00
parent c6c8cabdaf
commit c47e30e960
2 changed files with 4 additions and 6 deletions

View file

@ -39,7 +39,6 @@ impl State {
/// return amount of repetitive mouse clicks
/// (1 -> double click, 2 -> triple click)
pub fn update(&mut self, position: Point) -> Interaction {
self.last_click_timestamp = Some(SystemTime::now());
self.last_click = match self.last_click {
None => Some(Interaction::Click(position)),
Some(x) => match x {
@ -54,6 +53,7 @@ impl State {
_ => Some(Interaction::Click(position)),
},
};
self.last_click_timestamp = Some(SystemTime::now());
self.last_click.unwrap_or(Interaction::Click(position))
}