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

Unified Diff: ui/gfx/point_base.h

Issue 11293194: ui: Prefer +/- operators to apply offsets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: floats Created 8 years, 1 month 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
« .gitmodules ('K') | « ui/gfx/point.h ('k') | ui/gfx/point_f.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/point_base.h
diff --git a/ui/gfx/point_base.h b/ui/gfx/point_base.h
index ae3342c4dcf1706fc2a9b6b71aab202437d89167..25785207011ea4316f7d43769a9fbbff5594396f 100644
--- a/ui/gfx/point_base.h
+++ b/ui/gfx/point_base.h
@@ -34,11 +34,13 @@ class UI_EXPORT PointBase {
}
void operator+=(const VectorClass& vector) {
- Offset(vector.x(), vector.y());
+ x_ += vector.x();
+ y_ += vector.y();
}
void operator-=(const VectorClass& vector) {
- Offset(-vector.x(), -vector.y());
+ x_ -= vector.x();
+ y_ -= vector.y();
}
bool IsOrigin() const {
@@ -49,10 +51,6 @@ class UI_EXPORT PointBase {
return VectorClass(x_, y_);
}
- VectorClass OffsetFrom(const Class& other) const {
- return VectorClass(x_ - other.x_, y_ - other.y_);
- }
-
// 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
« .gitmodules ('K') | « ui/gfx/point.h ('k') | ui/gfx/point_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698