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

Unified Diff: ui/gfx/point.h

Issue 11028127: Implicit coversion operators from integer geometry types to floating point. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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/base/win/hwnd_util.cc ('k') | ui/gfx/point_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/point.h
diff --git a/ui/gfx/point.h b/ui/gfx/point.h
index 1f437cdf33c677f124e55bb1f50eb1989759a508..5984d74655d9ab14ddda6074f703e72e7ad88da0 100644
--- a/ui/gfx/point.h
+++ b/ui/gfx/point.h
@@ -44,7 +44,7 @@ class UI_EXPORT Point : public PointBase<Point, int> {
CGPoint ToCGPoint() const;
#endif
- PointF ToPointF() const {
+ operator PointF() const {
return PointF(x(), y());
}
@@ -60,6 +60,14 @@ class UI_EXPORT Point : public PointBase<Point, int> {
std::string ToString() const;
};
+inline bool operator==(const Point& lhs, const Point& rhs) {
+ return lhs.x() == rhs.x() && lhs.y() == rhs.y();
+}
+
+inline bool operator!=(const Point& lhs, const Point& rhs) {
+ return !(lhs == rhs);
+}
+
inline Point operator+(Point lhs, Point rhs) {
return lhs.Add(rhs);
}
« no previous file with comments | « ui/base/win/hwnd_util.cc ('k') | ui/gfx/point_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698