Chromium Code Reviews| 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 #ifndef UI_GFX_POINT_F_H_ | 5 #ifndef UI_GFX_POINT_F_H_ |
| 6 #define UI_GFX_POINT_F_H_ | 6 #define UI_GFX_POINT_F_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ui/base/ui_export.h" | 10 #include "ui/base/ui_export.h" |
| 11 #include "ui/gfx/point_base.h" | 11 #include "ui/gfx/point_base.h" |
| 12 | 12 |
| 13 namespace gfx { | 13 namespace gfx { |
| 14 class Point; | |
| 15 | 14 |
| 16 // A floating version of gfx::Point. | 15 // A floating version of gfx::Point. |
| 17 class UI_EXPORT PointF : public PointBase<PointF, float> { | 16 class UI_EXPORT PointF : public PointBase<PointF, float> { |
| 18 public: | 17 public: |
| 19 PointF(); | 18 PointF(); |
| 20 PointF(float x, float y); | 19 PointF(float x, float y); |
| 21 explicit PointF(Point& point); | 20 ~PointF(); |
| 22 ~PointF() {} | |
| 23 | |
| 24 Point ToPoint() const; | |
| 25 | 21 |
| 26 // Returns a string representation of point. | 22 // Returns a string representation of point. |
| 27 std::string ToString() const; | 23 std::string ToString() const; |
| 28 }; | 24 }; |
| 29 | 25 |
| 26 inline PointF operator+(PointF lhs, PointF rhs) { | |
|
sky
2012/10/01 21:02:20
const Point& here (and 30).
danakj
2012/10/01 22:03:37
Done.
| |
| 27 return lhs.Add(rhs); | |
| 28 } | |
| 29 | |
| 30 inline PointF operator-(PointF lhs, PointF rhs) { | |
| 31 return lhs.Subtract(rhs); | |
| 32 } | |
| 33 | |
| 30 #if !defined(COMPILER_MSVC) | 34 #if !defined(COMPILER_MSVC) |
| 31 extern template class PointBase<PointF, float>; | 35 extern template class PointBase<PointF, float>; |
| 32 #endif | 36 #endif |
| 33 | 37 |
| 34 } // namespace gfx | 38 } // namespace gfx |
| 35 | 39 |
| 36 #endif // UI_GFX_POINT_F_H_ | 40 #endif // UI_GFX_POINT_F_H_ |
| OLD | NEW |