#include <insets.h>
Definition at line 26 of file insets.h.
◆ Insets() [1/4]
constexpr gfx::Insets::Insets |
( |
| ) |
|
|
inlineconstexpr |
Definition at line 28 of file insets.h.
28: top_(0), left_(0), bottom_(0), right_(0) {}
◆ Insets() [2/4]
constexpr gfx::Insets::Insets |
( |
int |
all | ) |
|
|
inlineexplicitconstexpr |
Definition at line 29 of file insets.h.
32 bottom_(GetClampedValue(
all,
all)),
33 right_(GetClampedValue(
all,
all)) {}
SIT bool all(const Vec< 1, T > &x)
◆ Insets() [3/4]
constexpr gfx::Insets::Insets |
( |
int |
vertical, |
|
|
int |
horizontal |
|
) |
| |
|
inlineexplicitconstexpr |
Definition at line 34 of file insets.h.
35 : top_(vertical),
36 left_(horizontal),
37 bottom_(GetClampedValue(vertical, vertical)),
38 right_(GetClampedValue(horizontal, horizontal)) {}
◆ Insets() [4/4]
constexpr gfx::Insets::Insets |
( |
int |
top, |
|
|
int |
left, |
|
|
int |
bottom, |
|
|
int |
right |
|
) |
| |
|
inlineconstexpr |
Definition at line 39 of file insets.h.
constexpr int right() const
constexpr int bottom() const
constexpr int top() const
constexpr int left() const
◆ bottom()
constexpr int gfx::Insets::bottom |
( |
| ) |
const |
|
inlineconstexpr |
◆ height()
constexpr int gfx::Insets::height |
( |
| ) |
const |
|
inlineconstexpr |
Definition at line 56 of file insets.h.
56{ return top_ + bottom_; }
◆ IsEmpty()
bool gfx::Insets::IsEmpty |
( |
| ) |
const |
|
inline |
Definition at line 63 of file insets.h.
constexpr int width() const
constexpr int height() const
◆ left()
constexpr int gfx::Insets::left |
( |
| ) |
const |
|
inlineconstexpr |
◆ Offset()
Definition at line 17 of file insets.cc.
17 {
19 base::ClampAdd(
left(), vector.
x()),
20 base::ClampSub(
bottom(), vector.
y()),
21 base::ClampSub(
right(), vector.
x()));
22}
◆ operator InsetsF()
gfx::Insets::operator InsetsF |
( |
| ) |
const |
|
inline |
Definition at line 124 of file insets.h.
124 {
125 return InsetsF(
static_cast<float>(
top()),
static_cast<float>(
left()),
126 static_cast<float>(
bottom()),
static_cast<float>(
right()));
127 }
◆ operator!=()
bool gfx::Insets::operator!= |
( |
const Insets & |
insets | ) |
const |
|
inline |
Definition at line 88 of file insets.h.
88{ return !(*this == insets); }
◆ operator+=()
void gfx::Insets::operator+= |
( |
const Insets & |
insets | ) |
|
|
inline |
Definition at line 90 of file insets.h.
90 {
91 top_ = base::ClampAdd(top_, insets.top_);
92 left_ = base::ClampAdd(left_, insets.left_);
93 bottom_ = GetClampedValue(top_, base::ClampAdd(bottom_, insets.bottom_));
94 right_ = GetClampedValue(left_, base::ClampAdd(right_, insets.right_));
95 }
◆ operator-()
Insets gfx::Insets::operator- |
( |
| ) |
const |
|
inline |
Definition at line 104 of file insets.h.
104 {
108 }
constexpr ClampedNumeric< typename UnderlyingType< T >::type > MakeClampedNum(const T value)
◆ operator-=()
void gfx::Insets::operator-= |
( |
const Insets & |
insets | ) |
|
|
inline |
Definition at line 97 of file insets.h.
97 {
98 top_ = base::ClampSub(top_, insets.top_);
99 left_ = base::ClampSub(left_, insets.left_);
100 bottom_ = GetClampedValue(top_, base::ClampSub(bottom_, insets.bottom_));
101 right_ = GetClampedValue(left_, base::ClampSub(right_, insets.right_));
102 }
◆ operator==()
bool gfx::Insets::operator== |
( |
const Insets & |
insets | ) |
const |
|
inline |
Definition at line 83 of file insets.h.
83 {
84 return top_ == insets.top_ && left_ == insets.left_ &&
85 bottom_ == insets.bottom_ && right_ == insets.right_;
86 }
◆ right()
constexpr int gfx::Insets::right |
( |
| ) |
const |
|
inlineconstexpr |
◆ Scale() [1/2]
Insets gfx::Insets::Scale |
( |
float |
scale | ) |
const |
|
inline |
Definition at line 110 of file insets.h.
Insets Scale(float scale) const
◆ Scale() [2/2]
Insets gfx::Insets::Scale |
( |
float |
x_scale, |
|
|
float |
y_scale |
|
) |
| const |
|
inline |
Definition at line 112 of file insets.h.
112 {
113 return Insets(
static_cast<int>(base::ClampMul(
top(), y_scale)),
114 static_cast<int>(base::ClampMul(
left(), x_scale)),
115 static_cast<int>(base::ClampMul(
bottom(), y_scale)),
116 static_cast<int>(base::ClampMul(
right(), x_scale)));
117 }
◆ Set()
void gfx::Insets::Set |
( |
int |
top, |
|
|
int |
left, |
|
|
int |
bottom, |
|
|
int |
right |
|
) |
| |
|
inline |
Definition at line 76 of file insets.h.
76 {
79 bottom_ = GetClampedValue(top_,
bottom);
80 right_ = GetClampedValue(left_,
right);
81 }
◆ set_bottom()
void gfx::Insets::set_bottom |
( |
int |
bottom | ) |
|
|
inline |
Definition at line 73 of file insets.h.
73{ bottom_ = GetClampedValue(top_,
bottom); }
◆ set_left()
void gfx::Insets::set_left |
( |
int |
left | ) |
|
|
inline |
Definition at line 69 of file insets.h.
69 {
71 right_ = GetClampedValue(left_, right_);
72 }
◆ set_right()
void gfx::Insets::set_right |
( |
int |
right | ) |
|
|
inline |
Definition at line 74 of file insets.h.
74{ right_ = GetClampedValue(left_,
right); }
◆ set_top()
void gfx::Insets::set_top |
( |
int |
top | ) |
|
|
inline |
Definition at line 65 of file insets.h.
65 {
67 bottom_ = GetClampedValue(top_, bottom_);
68 }
◆ size()
constexpr Size gfx::Insets::size |
( |
| ) |
const |
|
inlineconstexpr |
◆ top()
constexpr int gfx::Insets::top |
( |
| ) |
const |
|
inlineconstexpr |
◆ ToString()
std::string gfx::Insets::ToString |
( |
| ) |
const |
Definition at line 12 of file insets.cc.
12 {
13
15}
std::string StringPrintf(const std::string &format, Args... args)
◆ width()
constexpr int gfx::Insets::width |
( |
| ) |
const |
|
inlineconstexpr |
Definition at line 52 of file insets.h.
52{ return left_ + right_; }
The documentation for this class was generated from the following files:
- third_party/accessibility/gfx/geometry/insets.h
- third_party/accessibility/gfx/geometry/insets.cc