5#ifndef UI_GFX_GEOMETRY_INSETS_F_H_
6#define UI_GFX_GEOMETRY_INSETS_F_H_
17 constexpr InsetsF() : top_(0.f), left_(0.f), bottom_(0.f), right_(0.f) {}
20 constexpr InsetsF(
float vertical,
float horizontal)
25 constexpr InsetsF(
float top,
float left,
float bottom,
float right)
26 : top_(top), left_(left), bottom_(bottom), right_(right) {}
28 constexpr float top()
const {
return top_; }
29 constexpr float left()
const {
return left_; }
30 constexpr float bottom()
const {
return bottom_; }
31 constexpr float right()
const {
return right_; }
35 constexpr float width()
const {
return left_ + right_; }
39 constexpr float height()
const {
return top_ + bottom_; }
44 void Set(
float top,
float left,
float bottom,
float right) {
52 return top_ == insets.top_ && left_ == insets.left_ &&
53 bottom_ == insets.bottom_ && right_ == insets.right_;
60 left_ += insets.left_;
61 bottom_ += insets.bottom_;
62 right_ += insets.right_;
67 left_ -= insets.left_;
68 bottom_ -= insets.bottom_;
69 right_ -= insets.right_;
73 return InsetsF(-top_, -left_, -bottom_, -right_);
InsetsF Scale(float scale) const
InsetsF operator-() const
bool operator!=(const InsetsF &insets) const
constexpr float left() const
constexpr float bottom() const
constexpr float height() const
constexpr float width() const
constexpr InsetsF(float vertical, float horizontal)
void operator+=(const InsetsF &insets)
constexpr InsetsF(float all)
constexpr float top() const
void Set(float top, float left, float bottom, float right)
bool operator==(const InsetsF &insets) const
constexpr InsetsF(float top, float left, float bottom, float right)
constexpr float right() const
void operator-=(const InsetsF &insets)
Insets operator+(Insets lhs, const Insets &rhs)
Insets operator-(Insets lhs, const Insets &rhs)
static std::string ToString(CompilerBackend::Type type)
SIT bool all(const Vec< 1, T > &x)