Implement Mul<Transformation> for mouse::Cursor

This commit is contained in:
Andy Terra 2025-01-27 23:05:24 -05:00
parent 00a048677f
commit 0802ed3b3a

View file

@ -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()