diff options
| author | 2025-01-27 23:05:51 -0500 | |
|---|---|---|
| committer | 2025-01-27 23:05:51 -0500 | |
| commit | 34673fc54f3a2dd7c7f91a0b82ea312b1d01c83e (patch) | |
| tree | 7421b51e75bcfbccb80e88b1b0917dcbebc149ca /core | |
| parent | 0802ed3b3af8f1908bdf3bc447c5ab91de3eae3c (diff) | |
| download | iced-34673fc54f3a2dd7c7f91a0b82ea312b1d01c83e.tar.gz iced-34673fc54f3a2dd7c7f91a0b82ea312b1d01c83e.tar.bz2 iced-34673fc54f3a2dd7c7f91a0b82ea312b1d01c83e.zip | |
Implement `Mul<Transformation>` for `mouse::Click`
Diffstat (limited to '')
| -rw-r--r-- | core/src/mouse/click.rs | 17 | 
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, +        } +    } +} | 
