FGeometry::GetLayoutBoundingRect
#include "Layout/Geometry.h"
Access: public
Specifiers: FORCEINLINE_DEBUGGABLEconst
Description
Returns the axis-aligned bounding rectangle of this geometry in absolute space, computed using the accumulated layout transform (without render transforms).
Caveats & Gotchas
- • Ignores render transforms — if a widget has a rotation or skew render transform, the layout bounding rect will not match what is visually rendered on screen. Use GetRenderBoundingRect() for the visual footprint.
- • The rect is in the same absolute coordinate space as AbsolutePosition — window space or desktop space depending on the widget hierarchy root.
- • Overloads accepting FMargin or FSlateRect allow you to extend or restrict the rect before transforming, which is more efficient than computing the bounding rect and then modifying it.
Signature
FORCEINLINE_DEBUGGABLE FSlateRect GetLayoutBoundingRect() const Return Type
FSlateRect Example
Culling: skip paint if rect is outside clip region C++
FSlateRect LayoutBounds = MyGeometry.GetLayoutBoundingRect();
if (!FSlateRect::DoRectanglesIntersect(LayoutBounds, MyCullRect))
{
return; // Fully culled, skip expensive paint
} Tags
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?