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

Unified Diff: ui/gfx/rect_f.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_f.h ('k') | ui/gfx/rect_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/rect_f.cc
diff --git a/ui/gfx/rect_f.cc b/ui/gfx/rect_f.cc
index fa4e99d17cbd7f12fdfe60ef605f467d053c7630..4413fb85f71832024f3b1c560aada3aabe590799 100644
--- a/ui/gfx/rect_f.cc
+++ b/ui/gfx/rect_f.cc
@@ -52,6 +52,18 @@ std::string RectF::ToString() const {
size().ToString().c_str());
}
+RectF operator+(const RectF& lhs, const Vector2dF& rhs) {
+ RectF result(lhs);
+ result += rhs;
+ return result;
+}
+
+RectF operator-(const RectF& lhs, const Vector2dF& rhs) {
+ RectF result(lhs);
+ result -= rhs;
+ return result;
+}
+
RectF IntersectRects(const RectF& a, const RectF& b) {
RectF result = a;
result.Intersect(b);
« .gitmodules ('K') | « ui/gfx/rect_f.h ('k') | ui/gfx/rect_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698