use crate::vec2::Vec2; use num::{Num, ToPrimitive}; #[derive(Copy, Clone)] pub struct Rect { pub pos: Vec2, pub size: Vec2, } impl Rect { pub fn new(x: T, y: T, w: T, h: T) -> Rect { Rect { pos: Vec2 { x, y }, size: Vec2 { x: w, y: h }, } } }