Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: ui/views/layout/box_layout.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/animation/bounds_animator_unittest.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/layout/box_layout.cc
diff --git a/ui/views/layout/box_layout.cc b/ui/views/layout/box_layout.cc
index 59ea091089b0001e404710fa077d170f581bdae0..319efa770c3677a9a9a97fa545f9854be201be17 100644
--- a/ui/views/layout/box_layout.cc
+++ b/ui/views/layout/box_layout.cc
@@ -72,7 +72,8 @@ void BoxLayout::Layout(View* host) {
y += size.height() + between_child_spacing_ + padding;
}
// Clamp child view bounds to |child_area|.
- child->SetBoundsRect(bounds.Intersect(child_area));
+ bounds.Intersect(child_area);
+ child->SetBoundsRect(bounds);
}
}
}
@@ -86,11 +87,11 @@ gfx::Size BoxLayout::GetPreferredSize(View* host) {
gfx::Size size(child->GetPreferredSize());
if (orientation_ == kHorizontal) {
gfx::Rect child_bounds(position, 0, size.width(), size.height());
- bounds = bounds.Union(child_bounds);
+ bounds.Union(child_bounds);
position += size.width();
} else {
gfx::Rect child_bounds(0, position, size.width(), size.height());
- bounds = bounds.Union(child_bounds);
+ bounds.Union(child_bounds);
position += size.height();
}
position += between_child_spacing_;
« no previous file with comments | « ui/views/animation/bounds_animator_unittest.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698