SBorder::ComputeDesiredSize

Compute the ideal size necessary to display this widget.

Windows
MacOS
Linux

Override Hierarchy

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/Layout/SBorder.h

Include

#include "Widgets/Layout/SBorder.h"

Source

/Engine/Source/Runtime/Slate/Private/Widgets/Layout/SBorder.cpp

Syntax

virtual FVector2D ComputeDesiredSize
(
    float LayoutScaleMultiplier
) const

Remarks

Compute the ideal size necessary to display this widget. For aggregate widgets (e.g. panels) this size should include the size necessary to show all of its children. CacheDesiredSize() guarantees that the size of descendants is computed and cached before that of the parents, so it is safe to call GetDesiredSize() for any children while implementing this method.

Note that ComputeDesiredSize() is meant as an aide to the developer. It is NOT meant to be very robust in many cases. If your widget is simulating a bouncing ball, you should just return a reasonable size; e.g. 160x160. Let the programmer set up a reasonable rule of resizing the bouncy ball simulation.

Returns

The desired size.

Parameters

Parameter

Description

LayoutScaleMultiplier

This parameter is safe to ignore for almost all widgets; only really affects text measuring.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback