#include <rect.h>
Public Member Functions | |
| constexpr | Rect ()=default |
| constexpr | Rect (int width, int height) |
| constexpr | Rect (int x, int y, int width, int height) |
| constexpr | Rect (const Size &size) |
| constexpr | Rect (const Point &origin, const Size &size) |
| constexpr int | x () const |
| void | set_x (int x) |
| constexpr int | y () const |
| void | set_y (int y) |
| constexpr int | width () const |
| void | set_width (int width) |
| constexpr int | height () const |
| void | set_height (int height) |
| constexpr const Point & | origin () const |
| void | set_origin (const Point &origin) |
| constexpr const Size & | size () const |
| void | set_size (const Size &size) |
| constexpr int | right () const |
| constexpr int | bottom () const |
| constexpr Point | top_right () const |
| constexpr Point | bottom_left () const |
| constexpr Point | bottom_right () const |
| constexpr Point | left_center () const |
| constexpr Point | top_center () const |
| constexpr Point | right_center () const |
| constexpr Point | bottom_center () const |
| Vector2d | OffsetFromOrigin () const |
| void | SetRect (int x, int y, int width, int height) |
| void | SetByBounds (int left, int top, int right, int bottom) |
| void | Inset (int horizontal, int vertical) |
| void | Inset (const Insets &insets) |
| void | Inset (int left, int top, int right, int bottom) |
| void | Offset (int horizontal, int vertical) |
| void | Offset (const Vector2d &distance) |
| void | operator+= (const Vector2d &offset) |
| void | operator-= (const Vector2d &offset) |
| Insets | InsetsFrom (const Rect &inner) const |
| bool | IsEmpty () const |
| bool | operator< (const Rect &other) const |
| bool | Contains (int point_x, int point_y) const |
| bool | Contains (const Point &point) const |
| bool | Contains (const Rect &rect) const |
| bool | Intersects (const Rect &rect) const |
| void | Intersect (const Rect &rect) |
| void | Union (const Rect &rect) |
| void | Subtract (const Rect &rect) |
| void | AdjustToFit (const Rect &rect) |
| Point | CenterPoint () const |
| void | ClampToCenteredSize (const Size &size) |
| void | Transpose () |
| void | SplitVertically (Rect *left_half, Rect *right_half) const |
| bool | SharesEdgeWith (const Rect &rect) const |
| int | ManhattanDistanceToPoint (const Point &point) const |
| int | ManhattanInternalDistance (const Rect &rect) const |
| std::string | ToString () const |
| bool | ApproximatelyEqual (const Rect &rect, int tolerance) const |
|
constexprdefault |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineexplicitconstexpr |
| void gfx::Rect::AdjustToFit | ( | const Rect & | rect | ) |
Definition at line 234 of file rect.cc.
References gfx::AdjustAlongAxis(), height(), SetRect(), width(), x(), and y().
Referenced by gfx::TEST().
| bool gfx::Rect::ApproximatelyEqual | ( | const Rect & | rect, |
| int | tolerance | ||
| ) | const |
|
inlineconstexpr |
Definition at line 97 of file rect.h.
Referenced by ApproximatelyEqual(), Contains(), Contains(), Inset(), InsetsFrom(), Intersect(), Intersects(), ManhattanDistanceToPoint(), gfx::ScaleToEnclosedRect(), gfx::ScaleToEnclosingRect(), gfx::ScaleToRoundedRect(), ui::AXPlatformNodeBase::ScrollToNode(), SetByBounds(), SharesEdgeWith(), Subtract(), gfx::TEST(), gfx::TEST(), gfx::TEST(), and Union().
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
| Point gfx::Rect::CenterPoint | ( | ) | const |
| void gfx::Rect::ClampToCenteredSize | ( | const Size & | size | ) |
|
inline |
Definition at line 156 of file rect.h.
References Contains(), gfx::Point::x(), and gfx::Point::y().
Referenced by Contains().
| bool gfx::Rect::Contains | ( | const Rect & | rect | ) | const |
| bool gfx::Rect::Contains | ( | int | point_x, |
| int | point_y | ||
| ) | const |
Definition at line 156 of file rect.cc.
References bottom(), right(), x(), and y().
Referenced by flutter::FlutterPlatformNodeDelegateWindows::HitTestSync(), Subtract(), and gfx::TEST().
|
inlineconstexpr |
Definition at line 79 of file rect.h.
Referenced by AdjustToFit(), CenterPoint(), ClampToCenteredSize(), flutter::FlutterPlatformNodeDelegateWindows::GetBoundsRect(), Inset(), ManhattanInternalDistance(), Offset(), operator+=(), operator<(), gfx::ScaleToEnclosedRect(), gfx::ScaleToEnclosingRect(), gfx::ScaleToEnclosingRectSafe(), gfx::ScaleToRoundedRect(), gfx::ScreenRectToNSRect(), ui::AXPlatformNodeBase::ScrollToNode(), SetByBounds(), SharesEdgeWith(), SplitVertically(), flutter::testing::TEST(), flutter::testing::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), and Transpose().
| void gfx::Rect::Inset | ( | const Insets & | insets | ) |
Definition at line 109 of file rect.cc.
References gfx::Insets::bottom(), Inset(), gfx::Insets::left(), gfx::Insets::right(), and gfx::Insets::top().
|
inline |
| void gfx::Rect::Inset | ( | int | left, |
| int | top, | ||
| int | right, | ||
| int | bottom | ||
| ) |
Definition at line 113 of file rect.cc.
References bottom(), height(), right(), set_height(), set_width(), and width().
| void gfx::Rect::Intersect | ( | const Rect & | rect | ) |
Definition at line 171 of file rect.cc.
References bottom(), IsEmpty(), right(), SetByBounds(), SetRect(), x(), and y().
Referenced by gfx::IntersectRects().
| bool gfx::Rect::Intersects | ( | const Rect & | rect | ) | const |
|
inline |
Definition at line 140 of file rect.h.
Referenced by ui::AXRange< AXPositionType >::GetRects(), Intersect(), Intersects(), and Union().
|
inlineconstexpr |
| int gfx::Rect::ManhattanDistanceToPoint | ( | const Point & | point | ) | const |
Definition at line 276 of file rect.cc.
References bottom(), right(), gfx::Point::x(), x(), gfx::Point::y(), and y().
Referenced by ui::AXPlatformNodeBase::NearestLeafToPoint(), and ui::AXPlatformNodeBase::NearestTextIndexToPoint().
| int gfx::Rect::ManhattanInternalDistance | ( | const Rect & | rect | ) | const |
|
inline |
| void gfx::Rect::Offset | ( | int | horizontal, |
| int | vertical | ||
| ) |
Definition at line 121 of file rect.cc.
References height(), set_height(), set_width(), and width().
Referenced by TEST(), and gfx::TEST().
|
inline |
| void gfx::Rect::operator+= | ( | const Vector2d & | offset | ) |
Definition at line 128 of file rect.cc.
References height(), set_height(), set_width(), and width().
| void gfx::Rect::operator-= | ( | const Vector2d & | offset | ) |
| bool gfx::Rect::operator< | ( | const Rect & | other | ) | const |
|
inlineconstexpr |
Definition at line 82 of file rect.h.
Referenced by gfx::operator==(), gfx::TEST(), and ToString().
|
inlineconstexpr |
Definition at line 96 of file rect.h.
Referenced by ApproximatelyEqual(), Contains(), Contains(), Inset(), InsetsFrom(), Intersect(), Intersects(), ManhattanDistanceToPoint(), gfx::ScaleToEnclosedRect(), gfx::ScaleToEnclosingRect(), gfx::ScaleToRoundedRect(), ui::AXPlatformNodeBase::ScrollToNode(), SetByBounds(), SharesEdgeWith(), SplitVertically(), Subtract(), gfx::TEST(), gfx::TEST(), gfx::TEST(), and Union().
|
inlineconstexpr |
|
inline |
Definition at line 80 of file rect.h.
Referenced by Inset(), Offset(), operator+=(), and gfx::TEST().
|
inline |
Definition at line 83 of file rect.h.
Referenced by gfx::TEST().
|
inline |
Definition at line 91 of file rect.h.
Referenced by gfx::TEST().
|
inline |
Definition at line 77 of file rect.h.
Referenced by Inset(), Offset(), operator+=(), and gfx::TEST().
|
inline |
|
inline |
| void gfx::Rect::SetByBounds | ( | int | left, |
| int | top, | ||
| int | right, | ||
| int | bottom | ||
| ) |
Definition at line 100 of file rect.cc.
References bottom(), height(), right(), gfx::SaturatedClampRange(), gfx::Point::SetPoint(), gfx::Size::SetSize(), width(), x(), and y().
Referenced by gfx::BoundingRect(), Intersect(), Subtract(), gfx::ToEnclosedRect(), gfx::ToEnclosedRectIgnoringError(), gfx::ToEnclosingRect(), gfx::ToEnclosingRectIgnoringError(), gfx::ToNearestRect(), gfx::ToRoundedRect(), and Union().
|
inline |
Definition at line 110 of file rect.h.
References height, width, x, and y.
Referenced by AdjustToFit(), ClampToCenteredSize(), Intersect(), SplitVertically(), Subtract(), gfx::TEST(), and Transpose().
| bool gfx::Rect::SharesEdgeWith | ( | const Rect & | rect | ) | const |
|
inlineconstexpr |
Definition at line 90 of file rect.h.
Referenced by ClampToCenteredSize(), gfx::operator==(), gfx::TEST(), and ToString().
Definition at line 260 of file rect.cc.
References BASE_DCHECK, height(), right(), SetRect(), width(), x(), and y().
Referenced by gfx::TEST().
| void gfx::Rect::Subtract | ( | const Rect & | rect | ) |
Definition at line 203 of file rect.cc.
References bottom(), Contains(), Intersects(), right(), SetByBounds(), SetRect(), x(), and y().
Referenced by gfx::SubtractRects(), and gfx::TEST().
|
inlineconstexpr |
|
inlineconstexpr |
| std::string gfx::Rect::ToString | ( | ) | const |
Definition at line 294 of file rect.cc.
References origin(), size(), base::StringPrintf(), and ToString().
Referenced by gfx::PrintTo(), and ToString().
| void gfx::Rect::Transpose | ( | ) |
| void gfx::Rect::Union | ( | const Rect & | rect | ) |
Definition at line 190 of file rect.cc.
References bottom(), IsEmpty(), right(), SetByBounds(), x(), and y().
Referenced by ManhattanInternalDistance(), and gfx::UnionRects().
|
inlineconstexpr |
Definition at line 76 of file rect.h.
Referenced by AdjustToFit(), CenterPoint(), ClampToCenteredSize(), flutter::FlutterPlatformNodeDelegateWindows::GetBoundsRect(), Inset(), ManhattanInternalDistance(), Offset(), operator+=(), operator<(), gfx::ScaleToEnclosedRect(), gfx::ScaleToEnclosingRect(), gfx::ScaleToEnclosingRectSafe(), gfx::ScaleToRoundedRect(), gfx::ScreenRectToNSRect(), ui::AXPlatformNodeBase::ScrollToNode(), SetByBounds(), SharesEdgeWith(), SplitVertically(), flutter::testing::TEST(), flutter::testing::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), and Transpose().
|
inlineconstexpr |
Definition at line 62 of file rect.h.
Referenced by AdjustToFit(), ApproximatelyEqual(), CenterPoint(), ClampToCenteredSize(), Contains(), Contains(), flutter::FlutterPlatformNodeDelegateWindows::GetBoundsRect(), InsetsFrom(), Intersect(), Intersects(), ManhattanDistanceToPoint(), ManhattanInternalDistance(), gfx::ScaleToEnclosedRect(), gfx::ScaleToEnclosingRect(), gfx::ScaleToEnclosingRectSafe(), gfx::ScaleToRoundedRect(), gfx::ScreenRectToNSRect(), ui::AXPlatformNodeBase::ScrollToNode(), SetByBounds(), SharesEdgeWith(), SplitVertically(), Subtract(), flutter::testing::TEST(), flutter::testing::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), Transpose(), and Union().
|
inlineconstexpr |
Definition at line 69 of file rect.h.
Referenced by AdjustToFit(), ApproximatelyEqual(), CenterPoint(), ClampToCenteredSize(), Contains(), Contains(), flutter::FlutterPlatformNodeDelegateWindows::GetBoundsRect(), InsetsFrom(), Intersect(), Intersects(), ManhattanDistanceToPoint(), ManhattanInternalDistance(), gfx::ScaleToEnclosedRect(), gfx::ScaleToEnclosingRect(), gfx::ScaleToEnclosingRectSafe(), gfx::ScaleToRoundedRect(), gfx::ScreenRectToNSRect(), ui::AXPlatformNodeBase::ScrollToNode(), SetByBounds(), SharesEdgeWith(), SplitVertically(), Subtract(), flutter::testing::TEST(), flutter::testing::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), gfx::TEST(), Transpose(), and Union().