Index: gfx/point.h |
=================================================================== |
--- gfx/point.h (revision 55264) |
+++ gfx/point.h (working copy) |
@@ -73,6 +73,16 @@ |
return !(*this == rhs); |
} |
+ // A point is less than another point if its y-value is closer |
+ // to the origin. If the y-values are the same, then point with |
+ // the x-value closer to the origin is considered less than the |
+ // other. |
+ // This comparison is required to use Points in sets, or sorted |
+ // vectors. |
+ bool operator<(const Point& rhs) const { |
+ return (y_ == rhs.y_) ? (x_ < rhs.x_) : (y_ < rhs.y_); |
+ } |
+ |
#if defined(OS_WIN) |
POINT ToPOINT() const; |
#elif defined(OS_MACOSX) |