summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 22:30:10 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 22:30:10 +0000
commitde8d613db2b9815b7c15fb2924dea1852ddd31e4 (patch)
tree4385225490617510aa24f4e20dda971495ab36aa /views
parent9619303bd885342dc36da0261d8f55049e5268a6 (diff)
downloadchromium_src-de8d613db2b9815b7c15fb2924dea1852ddd31e4.zip
chromium_src-de8d613db2b9815b7c15fb2924dea1852ddd31e4.tar.gz
chromium_src-de8d613db2b9815b7c15fb2924dea1852ddd31e4.tar.bz2
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
Diffstat (limited to 'views')
-rw-r--r--views/view.cc11
1 files changed, 8 insertions, 3 deletions
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();