#include "ui/gfx/geometry/rect_f.h"
#include <algorithm>
#include <limits>
#include "base/check.h"
#include "base/check_op.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "ui/gfx/geometry/insets_f.h"
#include "ui/gfx/geometry/outsets_f.h"
#if BUILDFLAG(IS_IOS)
#include <CoreGraphics/CoreGraphics.h>
#elif BUILDFLAG(IS_MAC)
#include <ApplicationServices/ApplicationServices.h>
#endif
namespace gfx {
static void AdjustAlongAxis(float dst_origin,
float dst_size,
float* origin,
float* size) { … }
#if BUILDFLAG(IS_APPLE)
RectF::RectF(const CGRect& r)
: origin_(r.origin.x, r.origin.y), size_(r.size.width, r.size.height) {
}
CGRect RectF::ToCGRect() const {
return CGRectMake(x(), y(), width(), height());
}
#endif
void RectF::Inset(const InsetsF& insets) { … }
void RectF::Offset(float horizontal, float vertical) { … }
void RectF::operator+=(const Vector2dF& offset) { … }
void RectF::operator-=(const Vector2dF& offset) { … }
InsetsF RectF::InsetsFrom(const RectF& inner) const { … }
bool RectF::operator<(const RectF& other) const { … }
bool RectF::Contains(float point_x, float point_y) const { … }
bool RectF::InclusiveContains(float point_x, float point_y) const { … }
bool RectF::Contains(const RectF& rect) const { … }
bool RectF::Intersects(const RectF& rect) const { … }
void RectF::Intersect(const RectF& rect) { … }
bool RectF::InclusiveIntersect(const RectF& rect) { … }
void RectF::Union(const RectF& rect) { … }
void RectF::UnionEvenIfEmpty(const RectF& rect) { … }
void RectF::Subtract(const RectF& rect) { … }
void RectF::AdjustToFit(const RectF& rect) { … }
PointF RectF::CenterPoint() const { … }
void RectF::ClampToCenteredSize(const SizeF& size) { … }
void RectF::Transpose() { … }
void RectF::SplitVertically(RectF& left_half, RectF& right_half) const { … }
void RectF::SplitHorizontally(RectF& top_half, RectF& bottom_half) const { … }
bool RectF::SharesEdgeWith(const RectF& rect) const { … }
float RectF::ManhattanDistanceToPoint(const PointF& point) const { … }
float RectF::ManhattanInternalDistance(const RectF& rect) const { … }
PointF RectF::ClosestPoint(const PointF& point) const { … }
bool RectF::IsExpressibleAsRect() const { … }
RectF IntersectRects(const RectF& a, const RectF& b) { … }
RectF UnionRects(const RectF& a, const RectF& b) { … }
RectF UnionRectsEvenIfEmpty(const RectF& a, const RectF& b) { … }
RectF SubtractRects(const RectF& a, const RectF& b) { … }
RectF BoundingRect(const PointF& p1, const PointF& p2) { … }
RectF MaximumCoveredRect(const RectF& a, const RectF& b) { … }
RectF MapRect(const RectF& r, const RectF& src_rect, const RectF& dest_rect) { … }
std::string RectF::ToString() const { … }
bool RectF::ApproximatelyEqual(const RectF& rect,
float tolerance_x,
float tolerance_y) const { … }
}