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

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: rebase Created 8 years, 2 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
« no previous file with comments | « ui/gfx/point.h ('k') | ui/gfx/point_f.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/point_f.h
diff --git a/ui/gfx/point_f.h b/ui/gfx/point_f.h
index e1871d81dea715ed43407f955273624f8c75b607..ff1c4dfdff0912077ea580070c0ffcc53b191964 100644
--- a/ui/gfx/point_f.h
+++ b/ui/gfx/point_f.h
@@ -11,22 +11,26 @@
#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();
// 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
« no previous file with comments | « ui/gfx/point.h ('k') | ui/gfx/point_f.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698