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

Unified Diff: ui/app_list/page_switcher.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/app_list/apps_grid_view.cc ('k') | ui/app_list/search_result_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/page_switcher.cc
diff --git a/ui/app_list/page_switcher.cc b/ui/app_list/page_switcher.cc
index b6a3b7a10a328c30aa210a58e4d680b589b3fd44..ba98671db832cff310d6e0c8c21812eb0d2c13a7 100644
--- a/ui/app_list/page_switcher.cc
+++ b/ui/app_list/page_switcher.cc
@@ -67,8 +67,8 @@ class PageSwitcherButton : public views::CustomButton {
private:
// Paints a button that has two rounded corner at bottom.
void PaintButton(gfx::Canvas* canvas, SkColor base_color) {
- gfx::Rect rect(GetContentsBounds().Center(
- gfx::Size(button_width_, kButtonHeight)));
+ gfx::Rect rect(GetContentsBounds());
+ rect.ClampToCenteredSize(gfx::Size(button_width_, kButtonHeight));
SkPath path;
path.addRoundRect(gfx::RectToSkRect(rect),
@@ -189,7 +189,8 @@ void PageSwitcher::Layout() {
rect.y(),
buttons_size.width(),
rect.height());
- buttons_->SetBoundsRect(rect.Intersect(buttons_bounds));
+ rect.Intersect(buttons_bounds);
+ buttons_->SetBoundsRect(rect);
}
void PageSwitcher::CalculateButtonWidthAndSpacing(int contents_width) {
« no previous file with comments | « ui/app_list/apps_grid_view.cc ('k') | ui/app_list/search_result_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698