OLD | NEW |
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" |
(...skipping 18 matching lines...) Expand all Loading... |
29 RectF::RectF(const gfx::SizeF& size) | 29 RectF::RectF(const gfx::SizeF& size) |
30 : RectBaseT(size) { | 30 : RectBaseT(size) { |
31 } | 31 } |
32 | 32 |
33 RectF::RectF(const gfx::PointF& origin, const gfx::SizeF& size) | 33 RectF::RectF(const gfx::PointF& origin, const gfx::SizeF& size) |
34 : RectBaseT(origin, size) { | 34 : RectBaseT(origin, size) { |
35 } | 35 } |
36 | 36 |
37 RectF::~RectF() {} | 37 RectF::~RectF() {} |
38 | 38 |
39 Rect RectF::ToRect() const { | |
40 return Rect(origin().ToPoint(), size().ToSize()); | |
41 } | |
42 | |
43 std::string RectF::ToString() const { | 39 std::string RectF::ToString() const { |
44 return base::StringPrintf("%s %s", | 40 return base::StringPrintf("%s %s", |
45 origin().ToString().c_str(), | 41 origin().ToString().c_str(), |
46 size().ToString().c_str()); | 42 size().ToString().c_str()); |
47 } | 43 } |
48 | 44 |
49 } // namespace gfx | 45 } // namespace gfx |
OLD | NEW |