summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/mouse/click.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/src/mouse/click.rs b/core/src/mouse/click.rs
index dd1c84cd..12039d79 100644
--- a/core/src/mouse/click.rs
+++ b/core/src/mouse/click.rs
@@ -1,7 +1,9 @@
//! Track mouse clicks.
use crate::mouse::Button;
use crate::time::Instant;
-use crate::Point;
+use crate::{Point, Transformation};
+
+use std::ops::Mul;
/// A mouse click.
#[derive(Debug, Clone, Copy)]
@@ -88,3 +90,16 @@ impl Click {
.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,
+ }
+ }
+}