Choose your operating system:
Windows
macOS
Linux
| SWidget::ComputeDesiredSize()
|
Module |
|
Header |
/Engine/Plugins/Experimental/CommonUI/Source/CommonUI/Public/CommonLoadGuard.h |
Include |
#include "CommonLoadGuard.h" |
Source |
/Engine/Plugins/Experimental/CommonUI/Source/CommonUI/Private/CommonLoadGuard.cpp |
virtual FVector2D ComputeDesiredSize
(
float LayoutScaleMultiplier
) const
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.
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.
The desired size.
Parameter |
Description |
---|---|
LayoutScaleMultiplier |
This parameter is safe to ignore for almost all widgets; only really affects text measuring. |