fn valid_bound(rect: &Rect) -> bool