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

Unified Diff: ui/base/native_theme/native_theme_base.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/base/gestures/gesture_point.cc ('k') | ui/base/win/hwnd_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/native_theme/native_theme_base.cc
diff --git a/ui/base/native_theme/native_theme_base.cc b/ui/base/native_theme/native_theme_base.cc
index 96c4a3c21f849a7e74bbe0f88b8a0061df4b984d..df9b7bf93ca9acef7ec9c66fe7b357f60eff3811 100644
--- a/ui/base/native_theme/native_theme_base.cc
+++ b/ui/base/native_theme/native_theme_base.cc
@@ -504,7 +504,8 @@ void NativeThemeBase::PaintCheckbox(SkCanvas* canvas,
rb.GetImageSkiaNamed(IDR_CHECKBOX_OFF);
}
- gfx::Rect bounds = rect.Center(gfx::Size(image->width(), image->height()));
+ gfx::Rect bounds = rect;
+ bounds.ClampToCenteredSize(gfx::Size(image->width(), image->height()));
DrawImageInt(canvas, *image, 0, 0, image->width(), image->height(),
bounds.x(), bounds.y(), bounds.width(), bounds.height());
}
@@ -655,7 +656,8 @@ void NativeThemeBase::PaintRadio(SkCanvas* canvas,
rb.GetImageSkiaNamed(IDR_RADIO_OFF);
}
- gfx::Rect bounds = rect.Center(gfx::Size(image->width(), image->height()));
+ gfx::Rect bounds = rect;
+ bounds.ClampToCenteredSize(gfx::Size(image->width(), image->height()));
DrawImageInt(canvas, *image, 0, 0, image->width(), image->height(),
bounds.x(), bounds.y(), bounds.width(), bounds.height());
}
« no previous file with comments | « ui/base/gestures/gesture_point.cc ('k') | ui/base/win/hwnd_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698