From ef5fcc06377af577dd52e0aad83ad0087d26099e Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Tue, 1 Nov 2005 23:47:28 +0000 Subject: [PATCH] Resolved a TODO git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14624 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Box.cpp | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/kits/interface/Box.cpp b/src/kits/interface/Box.cpp index 4a93a1c78a..3cc8539b31 100644 --- a/src/kits/interface/Box.cpp +++ b/src/kits/interface/Box.cpp @@ -243,13 +243,34 @@ void BBox::FrameResized(float width, float height) { BRect bounds(Bounds()); - - // TODO: only invalidate the part that really need redrawing! - + BRect r; + + if(fBounds.right < bounds.right) + { + r.left = fBounds.right; + r.top = 0; + r.right = bounds.right; + + if(fBounds.bottom < bounds.bottom) + r.bottom = bounds.bottom; + else + r.bottom = fBounds.bottom; + + Invalidate(r); + } + + if(fBounds.bottom < bounds.bottom) + { + r.left = 0; + r.top = fBounds.bottom; + r.right = bounds.right; + r.bottom = bounds.bottom; + + Invalidate(r); + } + fBounds.right = bounds.right; fBounds.bottom = bounds.bottom; - - Invalidate(); }