diff options
author | 2025-01-27 23:05:24 -0500 | |
---|---|---|
committer | 2025-01-27 23:05:24 -0500 | |
commit | 0802ed3b3af8f1908bdf3bc447c5ab91de3eae3c (patch) | |
tree | 200c20a81a218a59b8820308932e69db239504c5 /core | |
parent | 00a048677fc43a5e3106dff17e0c1c490fdc5ce1 (diff) | |
download | iced-0802ed3b3af8f1908bdf3bc447c5ab91de3eae3c.tar.gz iced-0802ed3b3af8f1908bdf3bc447c5ab91de3eae3c.tar.bz2 iced-0802ed3b3af8f1908bdf3bc447c5ab91de3eae3c.zip |
Implement `Mul<Transformation>` for `mouse::Cursor`
Diffstat (limited to 'core')
-rw-r--r-- | core/src/transformation.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/src/transformation.rs b/core/src/transformation.rs index 74183147..735fd9c4 100644 --- a/core/src/transformation.rs +++ b/core/src/transformation.rs @@ -1,3 +1,4 @@ +use crate::mouse::Cursor; use crate::{Point, Rectangle, Size, Vector}; use glam::{Mat4, Vec3, Vec4}; @@ -106,6 +107,19 @@ impl Mul<Transformation> for Rectangle { } } +impl Mul<Transformation> for Cursor { + type Output = Self; + + fn mul(self, transformation: Transformation) -> Self { + match self { + Cursor::Unavailable => Cursor::Unavailable, + Cursor::Available(point) => { + Cursor::Available(point * transformation) + } + } + } +} + impl AsRef<[f32; 16]> for Transformation { fn as_ref(&self) -> &[f32; 16] { self.0.as_ref() |