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

Unified Diff: ui/gfx/point_f.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/gfx/point_base.h ('k') | ui/gfx/point_unittest.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 a0b367f9789ea165b4efd8873720c3223e96d6ca..d6cded9c6fe11a7380518e6d35426862d19a6043 100644
--- a/ui/gfx/point_f.h
+++ b/ui/gfx/point_f.h
@@ -31,6 +31,14 @@ class UI_EXPORT PointF : public PointBase<PointF, float> {
std::string ToString() const;
};
+inline bool operator==(const PointF& lhs, const PointF& rhs) {
+ return lhs.x() == rhs.x() && lhs.y() == rhs.y();
+}
+
+inline bool operator!=(const PointF& lhs, const PointF& rhs) {
+ return !(lhs == rhs);
+}
+
inline PointF operator+(PointF lhs, PointF rhs) {
return lhs.Add(rhs);
}
« no previous file with comments | « ui/gfx/point_base.h ('k') | ui/gfx/point_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698