5#ifndef UI_GFX_GEOMETRY_RECT_F_H_
6#define UI_GFX_GEOMETRY_RECT_F_H_
18typedef struct CGRect CGRect;
42 explicit RectF(
const CGRect& r);
44 CGRect ToCGRect()
const;
47 constexpr float x()
const {
return origin_.x(); }
50 constexpr float y()
const {
return origin_.y(); }
53 constexpr float width()
const {
return size_.width(); }
56 constexpr float height()
const {
return size_.height(); }
62 constexpr const SizeF&
size()
const {
return size_; }
80 origin_.SetPoint(
x,
y);
85 void Inset(
float horizontal,
float vertical) {
86 Inset(horizontal, vertical, horizontal, vertical);
90 void Inset(
const InsetsF& insets);
93 void Inset(
float left,
float top,
float right,
float bottom);
96 void Offset(
float horizontal,
float vertical);
104 bool IsEmpty()
const {
return size_.IsEmpty(); }
117 bool Contains(
float point_x,
float point_y)
const;
127 bool Intersects(
const RectF&
rect)
const;
148 PointF CenterPoint()
const;
152 void ClampToCenteredSize(
const SizeF&
size);
158 void SplitVertically(
RectF* left_half,
RectF* right_half)
const;
162 bool SharesEdgeWith(
const RectF&
rect)
const;
166 float ManhattanDistanceToPoint(
const PointF& point)
const;
172 float ManhattanInternalDistance(
const RectF&
rect)
const;
177 void Scale(
float x_scale,
float y_scale) {
178 set_origin(
ScalePoint(origin(), x_scale, y_scale));
186 bool IsExpressibleAsRect()
const;
200 return !(lhs == rhs);
220 return RectF(r.
x() * x_scale, r.
y() * y_scale, r.
width() * x_scale, r.
height() * y_scale);
238void PrintTo(
const RectF&
rect, ::std::ostream* os);
static void Union(SkRegion *rgn, const SkIRect &rect)
constexpr float x() const
constexpr float y() const
constexpr RectF(const SizeF &size)
constexpr PointF top_right() const
constexpr PointF top_center() const
constexpr PointF bottom_left() const
Vector2dF OffsetFromOrigin() const
constexpr const PointF & origin() const
constexpr RectF()=default
void set_size(const SizeF &size)
constexpr float y() const
void set_origin(const PointF &origin)
constexpr float width() const
constexpr float height() const
constexpr RectF(const Rect &r)
constexpr float right() const
constexpr RectF(const PointF &origin, const SizeF &size)
constexpr const SizeF & size() const
constexpr PointF left_center() const
void set_width(float width)
constexpr PointF bottom_right() const
constexpr RectF(float x, float y, float width, float height)
constexpr float bottom() const
void set_height(float height)
constexpr PointF right_center() const
void Inset(float horizontal, float vertical)
constexpr RectF(float width, float height)
void Offset(const Vector2dF &distance)
bool Contains(const PointF &point) const
void SetRect(float x, float y, float width, float height)
constexpr float x() const
constexpr PointF bottom_center() const
void Scale(float x_scale, float y_scale)
constexpr float y() const
constexpr float x() const
sk_sp< SkBlender > blender SkRect rect
bool Contains(const Container &container, const Value &value)
Rect BoundingRect(const Point &p1, const Point &p2)
Rect IntersectRects(const Rect &a, const Rect &b)
Insets operator+(Insets lhs, const Insets &rhs)
Rect UnionRects(const Rect &a, const Rect &b)
Rect SubtractRects(const Rect &a, const Rect &b)
void PrintTo(const Point &point, ::std::ostream *os)
RectF ScaleRect(const RectF &r, float x_scale, float y_scale)
PointF ScalePoint(const PointF &p, float x_scale, float y_scale)
SizeF ScaleSize(const SizeF &s, float x_scale, float y_scale)
Insets operator-(Insets lhs, const Insets &rhs)
bool operator==(const Point &lhs, const Point &rhs)
constexpr size_t size(const T(&array)[N]) noexcept
bool operator!=(const Point &lhs, const Point &rhs)
static std::string ToString(CompilerBackend::Type type)
constexpr bool operator<(const EnumType &lhs, const Mask< EnumType > &rhs)
SINT Vec< N, T > & operator-=(Vec< N, T > &x, const Vec< N, T > &y)
SINT Vec< N, T > & operator+=(Vec< N, T > &x, const Vec< N, T > &y)