1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#[derive(Debug, Copy, Clone, PartialEq)] pub struct Rect { pub x: f32, pub y: f32, pub width: f32, pub height: f32, } impl Rect { pub fn new(x: f32, y: f32, width: f32, height: f32) -> Self { Rect { x: x, y: y, width: width, height: height, } } }