Index: ui/gfx/point_base.h |
diff --git a/ui/gfx/point_base.h b/ui/gfx/point_base.h |
index acaefe17805df6bbc2aa241805175eedea6c6656..24ce5f2195eb46f7454fcf9caf612f5080d4328e 100644 |
--- a/ui/gfx/point_base.h |
+++ b/ui/gfx/point_base.h |
@@ -41,6 +41,16 @@ class UI_EXPORT PointBase { |
Offset(-other.x(), -other.y()); |
} |
+ void ClampFromAbove(const Class& other) { |
sky
2012/11/09 18:23:12
Is there some other name we could use for these th
|
+ x_ = x_ <= other.x_ ? x_ : other.x_; |
+ y_ = y_ <= other.y_ ? y_ : other.y_; |
+ } |
+ |
+ void ClampFromBelow(const Class& other) { |
+ x_ = x_ >= other.x_ ? x_ : other.x_; |
+ y_ = y_ >= other.y_ ? y_ : other.y_; |
+ } |
+ |
Class Add(const VectorClass& other) const WARN_UNUSED_RESULT { |
const Class* orig = static_cast<const Class*>(this); |
Class copy = *orig; |