| 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/point_f.h" | 5 #include "ui/gfx/point_f.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "ui/gfx/point.h" | |
| 11 | 10 |
| 12 namespace gfx { | 11 namespace gfx { |
| 13 | 12 |
| 14 template class PointBase<PointF, float>; | 13 template class PointBase<PointF, float>; |
| 15 | 14 |
| 16 PointF::PointF() : PointBase<PointF, float>(0, 0) { | 15 PointF::PointF() : PointBase<PointF, float>(0, 0) { |
| 17 } | 16 } |
| 18 | 17 |
| 19 PointF::PointF(float x, float y) : PointBase<PointF, float>(x, y) { | 18 PointF::PointF(float x, float y) : PointBase<PointF, float>(x, y) { |
| 20 } | 19 } |
| 21 | 20 |
| 22 Point PointF::ToPoint() const { | 21 PointF::~PointF() {} |
| 23 return Point(static_cast<int>(std::floor(x())), | |
| 24 static_cast<int>(std::floor(y()))); | |
| 25 } | |
| 26 | 22 |
| 27 std::string PointF::ToString() const { | 23 std::string PointF::ToString() const { |
| 28 return base::StringPrintf("%f,%f", x(), y()); | 24 return base::StringPrintf("%f,%f", x(), y()); |
| 29 } | 25 } |
| 30 | 26 |
| 31 } // namespace gfx | 27 } // namespace gfx |
| OLD | NEW |