diff --git a/src/kits/interface/Box.cpp b/src/kits/interface/Box.cpp index 7efdbb45c9..955bd0fbe7 100644 --- a/src/kits/interface/Box.cpp +++ b/src/kits/interface/Box.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2015 Haiku, Inc. All Rights Reserved. + * Copyright 2001-2017 Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT license. * * Authors: @@ -322,7 +322,7 @@ BBox::FrameResized(float width, float height) // TODO: this must be made part of the be_control_look stuff! int32 borderSize = fStyle == B_PLAIN_BORDER ? 0 : 2; - BRect invalid(bounds); + BRect invalid(fBounds); if (fBounds.right < bounds.right) { // enlarging invalid.left = fBounds.right - borderSize; @@ -351,8 +351,8 @@ BBox::FrameResized(float width, float height) } } - fBounds.right = bounds.right; - fBounds.bottom = bounds.bottom; + fBounds.right = fBounds.left + width; + fBounds.bottom = fBounds.top + height; } @@ -395,6 +395,7 @@ void BBox::FrameMoved(BPoint newLocation) { BView::FrameMoved(newLocation); + fBounds.OffsetTo(newLocation); } diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index fb7a55fc0c..8f164a6987 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2015 Haiku, Inc. All rights reserved. + * Copyright 2001-2017 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -4894,10 +4894,8 @@ BView::MessageReceived(BMessage* message) if (!message->HasSpecifiers()) { switch (message->what) { case B_VIEW_RESIZED: - // By the time the message arrives, the bounds may have - // changed already, that's why we don't use the values - // in the message itself. - FrameResized(fBounds.Width(), fBounds.Height()); + FrameResized(message->GetInt32("width", 0), + message->GetInt32("height", 0)); break; case B_VIEW_MOVED: