library: core: film: add width/height methods
This commit is contained in:
parent
4c7085ab16
commit
7dc622b9e7
|
@ -26,6 +26,14 @@ impl Film {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn width(&self) -> u32 {
|
||||
self.x
|
||||
}
|
||||
|
||||
pub fn height(&self) -> u32 {
|
||||
self.y
|
||||
}
|
||||
|
||||
pub fn pixel_ratio(&self, x: f32, y: f32) -> (f32, f32) {
|
||||
(x / self.x as f32, y / self.y as f32)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue