diff --git a/Source/StevesUEHelpers/Private/StevesUI/RichTextBlockInputImageDecorator.cpp b/Source/StevesUEHelpers/Private/StevesUI/RichTextBlockInputImageDecorator.cpp index 75b6e16..d62bb4b 100644 --- a/Source/StevesUEHelpers/Private/StevesUI/RichTextBlockInputImageDecorator.cpp +++ b/Source/StevesUEHelpers/Private/StevesUI/RichTextBlockInputImageDecorator.cpp @@ -78,18 +78,16 @@ public: const TSharedRef FontMeasure = FSlateApplication::Get().GetRenderer()->GetFontMeasureService(); MaxCharHeight = FontMeasure->GetMaxCharacterHeight(TextStyle.Font, 1.0f); float IconHeight = FMath::Min(static_cast(MaxCharHeight), Brush.ImageSize.Y); - float IconWidth = Brush.ImageSize.X * (IconHeight / Brush.ImageSize.Y) ; - - if (Width.IsSet()) - { - IconWidth = Width.GetValue(); - } - if (Height.IsSet()) { IconHeight = Height.GetValue(); } + float IconWidth = Brush.ImageSize.X * (IconHeight / Brush.ImageSize.Y) ; + if (Width.IsSet()) + { + IconWidth = Width.GetValue(); + } ChildSlot [ @@ -133,17 +131,17 @@ public: TSharedPtr Widget = ChildSlot.GetWidget(); SBox* Box = static_cast(Widget.Get()); float IconHeight = FMath::Min(static_cast(MaxCharHeight), Brush.ImageSize.Y); + if (RequestedHeight.IsSet()) + { + IconHeight = RequestedHeight.GetValue(); + } + float IconWidth = Brush.ImageSize.X * (IconHeight / Brush.ImageSize.Y) ; - if (RequestedWidth.IsSet()) { IconWidth = RequestedWidth.GetValue(); } - if (RequestedHeight.IsSet()) - { - IconHeight = RequestedHeight.GetValue(); - } Box->SetWidthOverride(IconWidth); Box->SetHeightOverride(IconHeight);