From 9cf89c37de706358023917d6f523b6dadd7827b2 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Sun, 2 Oct 2016 15:33:55 -0700 Subject: [PATCH] Clear screen if a layer is shrinked --- src/views/stack_view.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/stack_view.rs b/src/views/stack_view.rs index f221ca4..0014eef 100644 --- a/src/views/stack_view.rs +++ b/src/views/stack_view.rs @@ -105,7 +105,11 @@ impl View for StackView { for layer in &mut self.layers { // Give each guy what he asks for, within the budget constraints. - layer.size = Vec2::min(size, layer.view.get_min_size(size)); + let size = Vec2::min(size, layer.view.get_min_size(size)); + if !layer.size.fits_in(size) { + ::B::clear(); + } + layer.size = size; layer.view.layout(layer.size); // We do it here instead of when adding a new layer because...?