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

Side by Side Diff: ui/gfx/rect_f.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RenderText fixup Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/rect_f.h" 5 #include "ui/gfx/rect_f.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "ui/gfx/insets_f.h" 9 #include "ui/gfx/insets_f.h"
10 #include "ui/gfx/rect_base_impl.h" 10 #include "ui/gfx/rect_base_impl.h"
11 11
12 namespace gfx { 12 namespace gfx {
13 13
14 template class RectBase<RectF, PointF, SizeF, InsetsF, float>; 14 template class RectBase<RectF, PointF, SizeF, InsetsF, Vector2dF, float>;
15 15
16 typedef class RectBase<RectF, PointF, SizeF, InsetsF, float> RectBaseT; 16 typedef class RectBase<RectF, PointF, SizeF, InsetsF, Vector2dF,
17 float> RectBaseT;
17 18
18 RectF::RectF() : RectBaseT(gfx::SizeF()) { 19 RectF::RectF() : RectBaseT(gfx::SizeF()) {
19 } 20 }
20 21
21 RectF::RectF(float width, float height) 22 RectF::RectF(float width, float height)
22 : RectBaseT(gfx::SizeF(width, height)) { 23 : RectBaseT(gfx::SizeF(width, height)) {
23 } 24 }
24 25
25 RectF::RectF(float x, float y, float width, float height) 26 RectF::RectF(float x, float y, float width, float height)
26 : RectBaseT(gfx::PointF(x, y), gfx::SizeF(width, height)) { 27 : RectBaseT(gfx::PointF(x, y), gfx::SizeF(width, height)) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 return result; 61 return result;
61 } 62 }
62 63
63 RectF ScaleRect(const RectF& r, float x_scale, float y_scale) { 64 RectF ScaleRect(const RectF& r, float x_scale, float y_scale) {
64 RectF result = r; 65 RectF result = r;
65 result.Scale(x_scale, y_scale); 66 result.Scale(x_scale, y_scale);
66 return result; 67 return result;
67 } 68 }
68 69
69 } // namespace gfx 70 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698