Files
UnrealEngineUWP/Engine/Source/Editor/PropertyEditor/Private/SConstrainedBox.cpp
sebastian nordgren 594a347d48 SPropertyEditorAsset now requests additional width based on the number of additional buttons it has (if it doesn't have a thumbnail).
#jira UETOOL-2815
#rb lauren.barnes

#ROBOMERGE-SOURCE: CL 15889436 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15890450 by sebastian nordgren in ue5-main branch]
2021-04-01 12:15:43 -04:00

38 lines
818 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "SConstrainedBox.h"
void SConstrainedBox::Construct(const FArguments& InArgs)
{
MinWidth = InArgs._MinWidth;
MaxWidth = InArgs._MaxWidth;
ChildSlot
[
InArgs._Content.Widget
];
}
FVector2D SConstrainedBox::ComputeDesiredSize(float LayoutScaleMultiplier) const
{
const float MinWidthVal = MinWidth.Get().Get(0.0f);
const float MaxWidthVal = MaxWidth.Get().Get(0.0f);
if (MinWidthVal == 0.0f && MaxWidthVal == 0.0f)
{
return SCompoundWidget::ComputeDesiredSize(LayoutScaleMultiplier);
}
else
{
FVector2D ChildSize = ChildSlot.GetWidget()->GetDesiredSize();
float XVal = FMath::Max(MinWidthVal, ChildSize.X);
if (MaxWidthVal > MinWidthVal)
{
XVal = FMath::Min(MaxWidthVal, XVal);
}
return FVector2D(XVal, ChildSize.Y);
}
}