#include <round_rect.h>
Public Member Functions | |
RoundRect ()=default | |
constexpr const Rect & | GetBounds () const |
constexpr const RoundingRadii & | GetRadii () const |
constexpr bool | IsFinite () const |
constexpr bool | IsEmpty () const |
constexpr bool | IsRect () const |
constexpr bool | IsOval () const |
bool | Contains (const Point &p) const |
Returns true iff the provided point |p| is inside the half-open interior of this rectangle. More... | |
RoundRect | Shift (Scalar dx, Scalar dy) const |
Returns a new round rectangle translated by the given offset. More... | |
RoundRect | Expand (Scalar left, Scalar top, Scalar right, Scalar bottom) const |
Returns a round rectangle with expanded edges. Negative expansion results in shrinking. More... | |
RoundRect | Expand (Scalar horizontal, Scalar vertical) const |
Returns a round rectangle with expanded edges. Negative expansion results in shrinking. More... | |
RoundRect | Expand (Scalar amount) const |
Returns a round rectangle with expanded edges. Negative expansion results in shrinking. More... | |
constexpr bool | operator== (const RoundRect &rr) const |
constexpr bool | operator!= (const RoundRect &r) const |
Static Public Member Functions | |
static RoundRect | MakeRect (const Rect &rect) |
static RoundRect | MakeOval (const Rect &rect) |
static RoundRect | MakeRectRadius (const Rect &rect, Scalar radius) |
static RoundRect | MakeRectXY (const Rect &rect, Scalar x_radius, Scalar y_radius) |
static RoundRect | MakeRectXY (const Rect &rect, Size corner_radii) |
static RoundRect | MakeNinePatch (const Rect &rect, Scalar left, Scalar top, Scalar right, Scalar bottom) |
static RoundRect | MakeRectRadii (const Rect &rect, const RoundingRadii &radii) |
Friends | |
class | RoundRectPathSource |
class | DiffRoundRectPathSource |
Definition at line 16 of file round_rect.h.
|
default |
Referenced by MakeRectRadii().
bool impeller::RoundRect::Contains | ( | const Point & | p | ) | const |
Returns true iff the provided point |p| is inside the half-open interior of this rectangle.
For purposes of containment, a rectangle contains points along the top and left edges but not points along the right and bottom edges so that a point is only ever considered inside one of two abutting rectangles.
Definition at line 73 of file round_rect.cc.
References impeller::RoundingRadii::bottom_left, impeller::RoundingRadii::bottom_right, impeller::TRect< T >::Contains(), impeller::CornerContains(), impeller::TRect< T >::GetLeftBottom(), impeller::TRect< T >::GetLeftTop(), impeller::TRect< T >::GetRightBottom(), impeller::TRect< T >::GetRightTop(), impeller::kLowerLeftDirection(), impeller::kLowerRightDirection(), impeller::kUpperLeftDirection(), impeller::kUpperRightDirection(), impeller::RoundingRadii::top_left, and impeller::RoundingRadii::top_right.
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
Definition at line 120 of file round_rect.h.
References impeller::TRect< T >::Expand(), and MakeRectRadii().
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
Definition at line 110 of file round_rect.h.
References impeller::TRect< T >::Expand(), and MakeRectRadii().
|
inline |
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
Definition at line 98 of file round_rect.h.
References impeller::TRect< T >::Expand(), and MakeRectRadii().
Referenced by impeller::testing::TEST().
|
inlineconstexpr |
Definition at line 53 of file round_rect.h.
Referenced by impeller::FillRoundRectGeometry::CoversArea(), impeller::Canvas::DrawRoundRect(), impeller::RoundRectPathSource::GetBounds(), impeller::DiffRoundRectPathSource::GetBounds(), std::operator<<(), and impeller::testing::TEST().
|
inlineconstexpr |
Definition at line 55 of file round_rect.h.
Referenced by impeller::FillRoundRectGeometry::CoversArea(), impeller::Canvas::DrawRoundRect(), std::operator<<(), and impeller::testing::TEST().
|
inlineconstexpr |
Definition at line 65 of file round_rect.h.
References impeller::TRect< T >::IsEmpty().
Referenced by impeller::testing::TEST().
|
inlineconstexpr |
Definition at line 57 of file round_rect.h.
References impeller::RoundingRadii::bottom_left, impeller::RoundingRadii::bottom_right, impeller::TRect< T >::IsFinite(), impeller::TSize< T >::IsFinite(), impeller::RoundingRadii::top_left, and impeller::RoundingRadii::top_right.
Referenced by impeller::testing::TEST().
|
inlineconstexpr |
Definition at line 71 of file round_rect.h.
References impeller::RoundingRadii::AreAllCornersSame(), impeller::TRect< T >::GetHeight(), impeller::TRect< T >::GetWidth(), impeller::TSize< T >::height, impeller::TRect< T >::IsEmpty(), impeller::ScalarNearlyEqual(), impeller::RoundingRadii::top_left, and impeller::TSize< T >::width.
Referenced by impeller::testing::TEST().
|
inlineconstexpr |
Definition at line 67 of file round_rect.h.
References impeller::RoundingRadii::AreAllCornersEmpty(), and impeller::TRect< T >::IsEmpty().
Referenced by impeller::testing::TEST().
|
inlinestatic |
Definition at line 42 of file round_rect.h.
References impeller::RoundingRadii::MakeNinePatch(), and MakeRectRadii().
Definition at line 23 of file round_rect.h.
References impeller::TRect< T >::GetSize(), impeller::RoundingRadii::MakeRadii(), and MakeRectRadii().
Referenced by impeller::testing::TEST().
Definition at line 19 of file round_rect.h.
References MakeRectRadii().
Referenced by impeller::testing::TEST().
|
static |
Definition at line 9 of file round_rect.cc.
References impeller::TRect< T >::GetPositive(), impeller::TRect< T >::IsFinite(), RoundRect(), and impeller::RoundingRadii::Scaled().
Referenced by impeller::interop::DisplayListBuilder::ClipRoundedRect(), impeller::interop::DisplayListBuilder::DrawRoundedRect(), impeller::interop::DisplayListBuilder::DrawRoundedRectDifference(), Expand(), MakeNinePatch(), MakeOval(), MakeRect(), MakeRectRadius(), MakeRectXY(), Shift(), impeller::testing::TEST(), and impeller::RoundSuperellipse::ToApproximateRoundRect().
|
inlinestatic |
Definition at line 27 of file round_rect.h.
References impeller::RoundingRadii::MakeRadius(), and MakeRectRadii().
Referenced by impeller::testing::TEST().
|
inlinestatic |
Definition at line 31 of file round_rect.h.
References impeller::RoundingRadii::MakeRadii(), and MakeRectRadii().
Referenced by impeller::testing::TEST().
|
inlinestatic |
Definition at line 38 of file round_rect.h.
References impeller::RoundingRadii::MakeRadii(), and MakeRectRadii().
|
inlineconstexpr |
Definition at line 131 of file round_rect.h.
|
inlineconstexpr |
Definition at line 127 of file round_rect.h.
Returns a new round rectangle translated by the given offset.
Definition at line 89 of file round_rect.h.
References MakeRectRadii(), and impeller::TRect< T >::Shift().
Referenced by impeller::testing::TEST().
|
friend |
Definition at line 146 of file round_rect.h.
|
friend |
Definition at line 145 of file round_rect.h.