Implement Mul<Transformation> for mouse::Click
This commit is contained in:
parent
0802ed3b3a
commit
34673fc54f
1 changed files with 16 additions and 1 deletions
|
|
@ -1,7 +1,9 @@
|
||||||
//! Track mouse clicks.
|
//! Track mouse clicks.
|
||||||
use crate::mouse::Button;
|
use crate::mouse::Button;
|
||||||
use crate::time::Instant;
|
use crate::time::Instant;
|
||||||
use crate::Point;
|
use crate::{Point, Transformation};
|
||||||
|
|
||||||
|
use std::ops::Mul;
|
||||||
|
|
||||||
/// A mouse click.
|
/// A mouse click.
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
|
|
@ -88,3 +90,16 @@ impl Click {
|
||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Mul<Transformation> for Click {
|
||||||
|
type Output = Click;
|
||||||
|
|
||||||
|
fn mul(self, transformation: Transformation) -> Click {
|
||||||
|
Click {
|
||||||
|
kind: self.kind,
|
||||||
|
button: self.button,
|
||||||
|
position: self.position * transformation,
|
||||||
|
time: self.time,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue