5#ifndef UI_GFX_GEOMETRY_SIZE_F_H_
6#define UI_GFX_GEOMETRY_SIZE_F_H_
20 constexpr SizeF() : width_(0.f), height_(0.f) {}
28 constexpr float width()
const {
return width_; }
29 constexpr float height()
const {
return height_; }
34 float GetArea()
const;
41 void Enlarge(
float grow_width,
float grow_height);
43 void SetToMin(
const SizeF& other);
44 void SetToMax(
const SizeF& other);
50 void Scale(
float x_scale,
float y_scale) {
57 static constexpr float kTrivial = 8.f * std::numeric_limits<float>::epsilon();
59 static constexpr float clamp(
float f) {
return f > kTrivial ?
f : 0.f; }
static unsigned clamp(SkFixed fx, int max)
constexpr SizeF(const Size &size)
void set_width(float width)
constexpr float height() const
constexpr SizeF(float width, float height)
void set_height(float height)
void SetSize(float width, float height)
constexpr float width() const
void Scale(float x_scale, float y_scale)
void PrintTo(const Point &point, ::std::ostream *os)
SizeF ScaleSize(const SizeF &s, float x_scale, float y_scale)
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)