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

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

Issue 2440723003: Tweaks to ToggleButton details. (Closed)
Patch Set: remove a little more Created 4 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
« no previous file with comments | « no previous file | ui/gfx/geometry/insets.cc » ('j') | ui/views/controls/button/toggle_button.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/insets.h
diff --git a/ui/gfx/geometry/insets.h b/ui/gfx/geometry/insets.h
index bc5e3460ca3bdff536c43c01226566aa11bde4e3..a88bae3e42bc43e9aa6d4e5ff13e212a416b8cb1 100644
--- a/ui/gfx/geometry/insets.h
+++ b/ui/gfx/geometry/insets.h
@@ -12,6 +12,8 @@
namespace gfx {
+class Vector2d;
+
// Represents the widths of the four borders or margins of an unspecified
// rectangle. An Insets stores the thickness of the top, left, bottom and right
// edges, without storing the actual size and position of the rectangle itself.
@@ -93,6 +95,11 @@ class GFX_EXPORT Insets {
static_cast<int>(right() * x_scale));
}
+ // Adjusts the vertical and horizontal dimensions by the values described in
+ // |vector|. Offsetting insets before applying to a rectangle would be
+ // equivalent to offseting the rectangle then applying the insets.
+ Insets Offset(const gfx::Vector2d& vector) const;
+
operator InsetsF() const {
return InsetsF(static_cast<float>(top()), static_cast<float>(left()),
static_cast<float>(bottom()), static_cast<float>(right()));
« no previous file with comments | « no previous file | ui/gfx/geometry/insets.cc » ('j') | ui/views/controls/button/toggle_button.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698