UMG Sprite DrawAs Box type Not working

I make Atlas Paper2D.
UMG Image set Brush SpriteTexture, DrawAs property Box type and Margin 0.25.
Unlike texture image, it does not working.
Is not use Border or Box type of paper2D sprite in UMG?

Fix brush UVRegion like this:

FixBrushUVRegion(FSlateImageBrush& InBrush, UObject* InTextureOrSprite)
{
if (const UPaperSprite* Sprite = Cast(InTextureOrSprite))
{
const FVector2D SourceUV = Sprite->GetSourceUV();
const FVector2D SourceSize = Sprite->GetSourceSize();
int32 SizeX = 1024;
int32 SizeY = 1024;
if (const UTexture2D* Texture = Sprite->GetSourceTexture())
{
SizeX = Texture->GetSizeX();
SizeY = Texture->GetSizeY();
}
const FVector2D BoxMin((float)SourceUV.X / (float)SizeX, (float)SourceUV.Y / (float)SizeY);
const FVector2D BoxMax((float)(SourceUV.X + SourceSize.X) / (float)SizeX, (float)(SourceUV.Y + SourceSize.Y) / (float)SizeY);
const FBox2D Box(BoxMin, BoxMax); // Box.bIsValid should be true.
InBrush.SetUVRegion( Box);
}
}

The Problem is your Sprite itself…
As shown on your picture, the sprite has white space around it… see:
Unbenannt

So, you need to include this into your calculation of the margin…

Oh… and… don’t use nonuniform numbers for image size… like your “149.752411”. Use either 150 or 149.

PS.:
Since the Unreal box margin is not working like 9-slicing from unity (where the center and mid-frame pieces get tiled), you better stay with a near center solution of a margin of 0.45. This is cause Unreal stretches the mid-pieces… Most of the time I need to use 0.47 - 0.49.