#include <point.h>
Definition at line 27 of file point.h.
◆ Point() [1/2]
constexpr gfx::Point::Point |
( |
| ) |
|
|
inlineconstexpr |
◆ Point() [2/2]
constexpr gfx::Point::Point |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inlineconstexpr |
◆ IsOrigin()
bool gfx::Point::IsOrigin |
( |
| ) |
const |
|
inline |
Definition at line 76 of file point.h.
76{ return x_ == 0 && y_ == 0; }
◆ Offset()
void gfx::Point::Offset |
( |
int |
delta_x, |
|
|
int |
delta_y |
|
) |
| |
|
inline |
Definition at line 58 of file point.h.
58 {
59 x_ = base::ClampAdd(x_, delta_x);
60 y_ = base::ClampAdd(y_, delta_y);
61 }
◆ OffsetFromOrigin()
Vector2d gfx::Point::OffsetFromOrigin |
( |
| ) |
const |
|
inline |
Definition at line 78 of file point.h.
78{ return Vector2d(x_, y_); }
◆ operator+=()
void gfx::Point::operator+= |
( |
const Vector2d & |
vector | ) |
|
|
inline |
Definition at line 63 of file point.h.
63 {
64 x_ = base::ClampAdd(x_, vector.x());
65 y_ = base::ClampAdd(y_, vector.y());
66 }
◆ operator-=()
void gfx::Point::operator-= |
( |
const Vector2d & |
vector | ) |
|
|
inline |
Definition at line 68 of file point.h.
68 {
69 x_ = base::ClampSub(x_, vector.x());
70 y_ = base::ClampSub(y_, vector.y());
71 }
◆ operator<()
bool gfx::Point::operator< |
( |
const Point & |
rhs | ) |
const |
|
inline |
Definition at line 86 of file point.h.
86{ return std::tie(y_, x_) < std::tie(rhs.y_, rhs.x_); }
◆ set_x()
void gfx::Point::set_x |
( |
int |
x | ) |
|
|
inline |
◆ set_y()
void gfx::Point::set_y |
( |
int |
y | ) |
|
|
inline |
◆ SetPoint()
void gfx::Point::SetPoint |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
◆ SetToMax()
void gfx::Point::SetToMax |
( |
const Point & |
other | ) |
|
Definition at line 58 of file point.cc.
58 {
59 x_ = x_ >= other.x_ ? x_ : other.x_;
60 y_ = y_ >= other.y_ ? y_ : other.y_;
61}
◆ SetToMin()
void gfx::Point::SetToMin |
( |
const Point & |
other | ) |
|
Definition at line 53 of file point.cc.
53 {
54 x_ = x_ <= other.x_ ? x_ : other.x_;
55 y_ = y_ <= other.y_ ? y_ : other.y_;
56}
◆ ToString()
std::string gfx::Point::ToString |
( |
| ) |
const |
Definition at line 63 of file point.cc.
63 {
65}
std::string StringPrintf(const std::string &format, Args... args)
◆ x()
constexpr int gfx::Point::x |
( |
| ) |
const |
|
inlineconstexpr |
◆ y()
constexpr int gfx::Point::y |
( |
| ) |
const |
|
inlineconstexpr |
The documentation for this class was generated from the following files:
- third_party/accessibility/gfx/geometry/point.h
- third_party/accessibility/gfx/geometry/point.cc