ComputePopupFitInRect

Given information about a popup and the space available for displaying that popup, compute best placement for it.

Windows
MacOS
Linux

References

Module

SlateCore

Header

/Engine/Source/Runtime/SlateCore/Public/Layout/LayoutUtils.h

Include

#include "Layout/LayoutUtils.h"

Source

/Engine/Source/Runtime/SlateCore/Private/Layout/LayoutUtils.cpp

Syntax

FVector2D ComputePopupFitInRect
(
    const FSlateRect & InAnchor,
    const FSlateRect & PopupRect,
    const EOrientation & Orientation,
    const FSlateRect & RectToFit
)

Remarks

Given information about a popup and the space available for displaying that popup, compute best placement for it.

Returns

A best position within the RectToFit such that none of the popup clips outside of the RectToFit.

Parameters

Parameter

Description

InAnchor

Area relative to which popup is being created (e.g. the button part of a combo box)

PopupRect

Proposed placement of popup; position may require adjustment.

Orientation

Are we trying to show the popup above/below or left/right relative to the anchor?

RectToFit

The space available for showing this popup; we want to fit entirely within it without clipping.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss