Index: ui/gfx/geometry/insets.cc |
diff --git a/ui/gfx/geometry/insets.cc b/ui/gfx/geometry/insets.cc |
index 1342a9d4dbc72039684885b3cd3f7b73ace8532c..2e6c8c77c3591aa02f4aa7ec92da71373a340f3f 100644 |
--- a/ui/gfx/geometry/insets.cc |
+++ b/ui/gfx/geometry/insets.cc |
@@ -5,6 +5,7 @@ |
#include "ui/gfx/geometry/insets.h" |
#include "base/strings/stringprintf.h" |
+#include "ui/gfx/geometry/vector2d.h" |
namespace gfx { |
@@ -13,4 +14,9 @@ std::string Insets::ToString() const { |
return base::StringPrintf("%d,%d,%d,%d", top(), left(), bottom(), right()); |
} |
+Insets operator+(const Insets& insets, const gfx::Vector2d& vector) { |
+ return gfx::Insets(insets.top() + vector.y(), insets.left() + vector.x(), |
+ insets.bottom() - vector.y(), insets.right() - vector.x()); |
+} |
+ |
} // namespace gfx |