From de8d613db2b9815b7c15fb2924dea1852ddd31e4 Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Mon, 25 Oct 2010 22:30:10 +0000 Subject: Fixes bug where we would some times not layout when we needed to. BUG=59720 TEST=see bug Review URL: http://codereview.chromium.org/3960004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63793 0039d316-1c4b-4281-b951-d872f2087c98 --- views/view.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'views') diff --git a/views/view.cc b/views/view.cc index 8235f25..a33d5be 100644 --- a/views/view.cc +++ b/views/view.cc @@ -114,8 +114,13 @@ int View::GetX(PositionMirroringSettings settings) const { } void View::SetBounds(const gfx::Rect& bounds) { - if (bounds == bounds_) + if (bounds == bounds_) { + if (needs_layout_) { + needs_layout_ = false; + Layout(); + } return; + } gfx::Rect prev = bounds_; bounds_ = bounds; @@ -227,8 +232,8 @@ void View::Layout() { } void View::InvalidateLayout() { - if (needs_layout_) - return; + // Always invalidate up. This is needed to handle the case of us already being + // valid, but not our parent. needs_layout_ = true; if (parent_) parent_->InvalidateLayout(); -- cgit v1.1