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

Unified Diff: ui/gfx/geometry/insets.cc

Issue 2440723003: Tweaks to ToggleButton details. (Closed)
Patch Set: Offset Created 4 years, 2 months 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
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

Powered by Google App Engine
This is Rietveld 408576698