Lines Matching defs:Insets
18 // rectangle. An Insets stores the thickness of the top, left, bottom and right
24 class GFX_EXPORT Insets {
26 constexpr Insets() : top_(0), left_(0), bottom_(0), right_(0) {}
27 constexpr explicit Insets(int all)
29 constexpr Insets(int vertical, int horizontal)
34 constexpr Insets(int top, int left, int bottom, int right)
42 // Returns the total width taken up by the insets, which is the sum of the
43 // left and right insets.
46 // Returns the total height taken up by the insets, which is the sum of the
47 // top and bottom insets.
50 // Returns true if the insets are empty.
60 bool operator==(const Insets& insets) const {
61 return top_ == insets.top_ && left_ == insets.left_ &&
62 bottom_ == insets.bottom_ && right_ == insets.right_;
65 bool operator!=(const Insets& insets) const {
66 return !(*this == insets);
69 void operator+=(const Insets& insets) {
70 top_ += insets.top_;
71 left_ += insets.left_;
72 bottom_ += insets.bottom_;
73 right_ += insets.right_;
76 void operator-=(const Insets& insets) {
77 top_ -= insets.top_;
78 left_ -= insets.left_;
79 bottom_ -= insets.bottom_;
80 right_ -= insets.right_;
83 Insets operator-() const {
84 return Insets(-top_, -left_, -bottom_, -right_);
87 Insets Scale(float scale) const {
91 Insets Scale(float x_scale, float y_scale) const {
92 return Insets(static_cast<int>(top() * y_scale),
99 // |vector|. Offsetting insets before applying to a rectangle would be
100 // equivalent to offseting the rectangle then applying the insets.
101 Insets Offset(const gfx::Vector2d& vector) const;
108 // Returns a string representation of the insets.
118 inline Insets operator+(Insets lhs, const Insets& rhs) {
123 inline Insets operator-(Insets lhs, const Insets& rhs) {