Retainer box fails to render child widgets reliably in 4.26

I have a map widget that uses a retainer box to hide parts of the map that you shouldn’t be able to see. This worked fine in previous versions of UE back to 4.20 at least. In 4.26 it has stopped working.

Bellow the retainer box is a canvas panel, bellow that is a widget that creates and handles the pieces of the map itself that should be visible or rotated based on the players position/movement.

The problem is that, nothing shows up. If I remove that canvas panel, and place the widget directly bellow the retainer box then I can see the widget showing up, but only partially. The parts of the map it should be showing only are actually visible and rendered if their pivot point/origin was itself visible in most cases. This means a section that should be mostly visible in the players map is simply not drawn and wont show up, as if clipping was enabled and the widgets size was 0x0 so it’ll only show when the widgets listed location is visible, not when any part of the image itself should be.

Here is an example of what it looks like if Retain Render is enabled on the Retainer Box.

https://i.imgur.com/sIZCAE1.png

And here is an example with Retain Render disabled on the Retainer Box, showing closer to what should actually be visible in that situation.

https://i.imgur.com/H4eMJG1.png

Ideally I’d hope there’s an option to make the Retainer Box fully render everything in it to the texture, but as of 4.26 it doesn’t seem to be, it is worth saying all child widgets do not having clipping enabled. I’ve tried messing with all the options on the retainer box itself, and on the children widgets and when present canvas panel but I’ve had no real luck in making this work.
If anyone does know a workaround, or an alternative to the Retainer Box for this method of hiding stuff you don’t want visible, that would be most appreciated. Otherwise, this seems like a bug that has been introduced in 4.26.

Bump, does anybody have an answer to this?

Don’t use source so can’t check this very well myself if it would work on my situation, but if I ever get a message back from Epic about the bug report I’ll be sure to include this as a possible starting point for them to look at in a response.

I ran into a similar issue where child widgets under a retainer (mostly text based) were not rendering correctly in 4.26. We use source, so not sure how much help this is, but I narrowed it down to the following change:

int32 SRetainerWidget::PaintSlowPath(const FSlateInvalidationContext& Context)
{
	FGeometry OriginalPaintSpaceGeometry = GetPaintSpaceGeometry();
	FSlateRenderTransform SimplifiedRenderTransform(OriginalPaintSpaceGeometry.GetAccumulatedRenderTransform().GetMatrix().GetScale(), OriginalPaintSpaceGeometry.GetAccumulatedRenderTransform().GetTranslation());
	const FGeometry NewPaintSpaceGeometry = FGeometry::MakeRoot(OriginalPaintSpaceGeometry.GetLocalSize(), FSlateLayoutTransform()).MakeChild(SimplifiedRenderTransform, FVector2D::ZeroVector);
	return SCompoundWidget::OnPaint(*Context.PaintArgs, NewPaintSpaceGeometry, Context.CullingRect, *Context.WindowElementList, Context.IncomingLayerId, Context.WidgetStyle, Context.bParentEnabled);
}

Prior to 4.26 thus function just used the GetPaintSpaceGeometry as the 2nd parameter in OnPaint directly:

int32 SRetainerWidget::PaintSlowPath(const FSlateInvalidationContext& Context)
{
	return SCompoundWidget::OnPaint(*Context.PaintArgs, GetPaintSpaceGeometry(), Context.CullingRect, *Context.WindowElementList, Context.IncomingLayerId, Context.WidgetStyle, Context.bParentEnabled);
}

Returning our code locally to that, has our child widgets displaying correctly and the retainer widget still apply its material correctly.

Would be great to know more information behind the change, to see if this is just a bug or if changing this back has some serious consequences.

Hello,

We’ve made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

Thanks