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

Unified Diff: ui/gfx/rect_f.h

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/gfx/rect_base_impl.h ('k') | ui/gfx/rect_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/rect_f.h
diff --git a/ui/gfx/rect_f.h b/ui/gfx/rect_f.h
index fbdeb4e157a0c6551550fdf4b7af6c6e06fe110c..4ee1098bf9c14bc3e3196567170f45e6bbd97ad1 100644
--- a/ui/gfx/rect_f.h
+++ b/ui/gfx/rect_f.h
@@ -27,14 +27,15 @@ class UI_EXPORT RectF : public RectBase<RectF, PointF, SizeF, InsetsF, float> {
~RectF();
/// Scales the rectangle by |scale|.
- RectF Scale(float scale) const WARN_UNUSED_RESULT {
- return Scale(scale, scale);
+ void Scale(float scale) {
+ Scale(scale, scale);
}
- RectF Scale(float x_scale, float y_scale) const WARN_UNUSED_RESULT {
+ void Scale(float x_scale, float y_scale) {
SizeF newSize = size().Scale(x_scale, y_scale);
newSize.ClampToNonNegative();
- return RectF(origin().Scale(x_scale, y_scale), newSize);
+ set_origin(origin().Scale(x_scale, y_scale));
+ set_size(newSize);
}
std::string ToString() const;
« no previous file with comments | « ui/gfx/rect_base_impl.h ('k') | ui/gfx/rect_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698