Index: ui/gfx/geometry/insets.cc |
diff --git a/ui/gfx/geometry/insets.cc b/ui/gfx/geometry/insets.cc |
index 1342a9d4dbc72039684885b3cd3f7b73ace8532c..9acc6e0fc1e182de19ecb46f63090ca663ce6682 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 Insets::Offset(const gfx::Vector2d& vector) const { |
+ return gfx::Insets(top() + vector.y(), left() + vector.x(), |
+ bottom() - vector.y(), right() - vector.x()); |
+} |
+ |
} // namespace gfx |