Add PointLike conversion for Transform.

This commit is contained in:
Nolan Darilek 2021-06-01 11:01:51 -05:00
parent 33921acee8
commit a2cf420963

View File

@ -347,6 +347,16 @@ pub trait PointLike {
}
}
impl PointLike for Transform {
fn x(&self) -> f32 {
self.translation.x
}
fn y(&self) -> f32 {
self.translation.y
}
}
impl PointLike for (i32, i32) {
fn x(&self) -> f32 {
self.0 as f32