RealDocs

UWidget::GetPaintSpaceGeometry

function UMG Blueprint Since 4.14
#include "Components/Widget.h"
Access: public Specifiers: UFUNCTIONBlueprintCallable

Description

Returns the geometry from the last paint pass, which reflects the widget's rendered position and size. When a widget's render transform differs from its layout transform, this geometry captures the painted state.

Caveats & Gotchas

  • Paint-space geometry is updated during the paint pass, which runs after Tick. Querying this from inside NativeTick gives the previous frame's painted geometry.
  • If a widget has a non-identity render transform (rotation, scale, shear), the paint geometry will differ from the layout geometry returned by GetCachedGeometry.
  • Like the other geometry getters, this returns a default zero-size geometry before the widget has been painted at least once.

Signature

UMG_API const FGeometry& GetPaintSpaceGeometry() const

Return Type

const FGeometry&

Example

Check if a point falls inside a rotated widget C++
// GetPaintSpaceGeometry accounts for RenderTransform, GetCachedGeometry does not
FGeometry PaintGeo = MyWidget->GetPaintSpaceGeometry();
bool bHit = USlateBlueprintLibrary::IsUnderLocation(PaintGeo, AbsolutePoint);

Version History

Introduced in: 4.14

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.