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

Unified Diff: ui/gfx/point_f.h

Issue 10993094: Make adding and subtracting gfx:: point types simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove some patch noise Created 8 years, 3 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
Index: ui/gfx/point_f.h
diff --git a/ui/gfx/point_f.h b/ui/gfx/point_f.h
index e1871d81dea715ed43407f955273624f8c75b607..e8dae2ab502c6f9266775ba81e9792b030416073 100644
--- a/ui/gfx/point_f.h
+++ b/ui/gfx/point_f.h
@@ -11,22 +11,27 @@
#include "ui/gfx/point_base.h"
namespace gfx {
-class Point;
// A floating version of gfx::Point.
class UI_EXPORT PointF : public PointBase<PointF, float> {
public:
PointF();
PointF(float x, float y);
- explicit PointF(Point& point);
- ~PointF() {}
-
- Point ToPoint() const;
+ PointF(const PointF& other);
sky 2012/09/28 23:05:49 Why remove the explicit?
+ ~PointF();
// Returns a string representation of point.
std::string ToString() const;
};
+inline PointF operator+(PointF lhs, PointF rhs) {
+ return lhs.Add(rhs);
+}
+
+inline PointF operator-(PointF lhs, PointF rhs) {
+ return lhs.Subtract(rhs);
+}
+
#if !defined(COMPILER_MSVC)
extern template class PointBase<PointF, float>;
#endif

Powered by Google App Engine
This is Rietveld 408576698