Frame not rendering when its position exceeds CanvasGroup bounds on Y axis

I’m making a drawing system using a CanvasGroup and frames. When the frames(the stroke/line) position exceeds the bounds of the CanvasGroup (i.e. < 0 or > height) on the Y axis, it doesn’t render at all. I find it especially weird considering it doesn’t happen on the X axis.
Any help would be appreciated.
Thanks!

This is an inherent feature of the CanvasGroup object.

Per the Wiki:
CanvasGroup always has GuiObject.ClipsDescendants set to true and all descendants will render within CanvasGroup’s viewport.

Use a Frame object and ensure ClipsDescendants is set to false if you want to render 2D Objects outside the bounds of its parent.

2 Likes

But shouldn’t ClipDescendants only prevent the exceeding part of the descentant from being rendered? I do want the frame to be clipped, but not completely, only the exceeding part of it. It behaves as expected when clipping left/right, but not top/bottom.

It does

You say you want only the exceeding part of it to clip, and that it behaves as expected when clipping left/right (aka the X-Axis)… but then in your earlier statement you say that it doesnt clip on the X axis…


Post a video or link or something of what you mean

What I meant was that the unexpected behaviour I described prior to that wasn’t happening on the X axis. So X axis behaves as expected, Y axis doesn’t.

I already posted a video in my original post. At 0:12, you can see the line disappear once the anchor point leaves the CanvasGroup. At 0:17 you can see that this doesn’t happen on the X axis.

Found a bug report which includes the solution:

Solution:

Or I can just use Path2D in my case