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

Unified Diff: ui/gfx/rect.cc

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/rect.h ('k') | ui/gfx/rect_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/rect.cc
diff --git a/ui/gfx/rect.cc b/ui/gfx/rect.cc
index d52332a119359b5e86f6d63a2ac4d448ae0dbd41..0fe38131de3e327a6f7f3ddb8201780f1b683600 100644
--- a/ui/gfx/rect.cc
+++ b/ui/gfx/rect.cc
@@ -90,6 +90,18 @@ std::string Rect::ToString() const {
size().ToString().c_str());
}
+Rect operator+(const Rect& lhs, const Vector2d& rhs) {
+ Rect result(lhs);
+ result += rhs;
+ return result;
+}
+
+Rect operator-(const Rect& lhs, const Vector2d& rhs) {
+ Rect result(lhs);
+ result -= rhs;
+ return result;
+}
+
Rect IntersectRects(const Rect& a, const Rect& b) {
Rect result = a;
result.Intersect(b);
« .gitmodules ('K') | « ui/gfx/rect.h ('k') | ui/gfx/rect_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698