Problem About FSlateDrawElement::MakeBox Function

99517-1.png

int32 SMyCompoundWidget::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& WidgetClippingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const
    {
    	FSlateRect Temp;
    	Temp.Top = WidgetClippingRect.Top;
    	Temp.Bottom = WidgetClippingRect.Bottom + 50.f;
    	Temp.Left = WidgetClippingRect.Left;
    	Temp.Right = WidgetClippingRect.Right;
    
            
    	// Draw background border layer
    	{
    		const FSlateBrush* ThisBackgroundImage = BackgroundImage.Get();
    		FSlateDrawElement::MakeBox(
    			OutDrawElements,
    			LayerId,
    			/*PaintGeom,*/AllottedGeometry.ToPaintGeometry(FVector2D::ZeroVector, FVector2D(100, 200)),
    			ThisBackgroundImage,
    			Temp,//*/WidgetClippingRect,
    			ESlateDrawEffect::None,
    			InWidgetStyle.GetColorAndOpacityTint() * ThisBackgroundImage->TintColor.GetColor(InWidgetStyle)
    			);
    	}
    	
 
    	FSlateDrawElement::MakeBox(
    		OutDrawElements,
    		LayerId,
    		AllottedGeometry.ToPaintGeometry(FVector2D::ZeroVector,FVector2D(5,5)),
    		SplinePointImageBrush.Get(),
    		WidgetClippingRect,
    		ESlateDrawEffect::None		
    		);
    	
    	return LayerId;
    }

How can I resolve this prolem?

I didn’t intend it.