From 34673fc54f3a2dd7c7f91a0b82ea312b1d01c83e Mon Sep 17 00:00:00 2001 From: Andy Terra <152812+airstrike@users.noreply.github.com> Date: Mon, 27 Jan 2025 23:05:51 -0500 Subject: Implement `Mul` for `mouse::Click` --- core/src/mouse/click.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'core/src') 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 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, + } + } +} -- cgit