diff --git a/src/views/panel.rs b/src/views/panel.rs index 8b1b1f1..64a11dd 100644 --- a/src/views/panel.rs +++ b/src/views/panel.rs @@ -20,7 +20,13 @@ impl ViewWrapper for Panel { fn wrap_required_size(&mut self, req: Vec2) -> Vec2 { // TODO: make borders conditional? - self.view.required_size(req - (2, 2)) + (2, 2) + let req = if Vec2::new(2, 2).fits_in(req) { + req - (2, 2) + } else { + Vec2::zero() + }; + + self.view.required_size(req) + (2, 2) } fn wrap_draw(&self, printer: &Printer) {