Add PointLike
conversion for Transform
.
This commit is contained in:
parent
33921acee8
commit
a2cf420963
10
src/core.rs
10
src/core.rs
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user