-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rect_clip_content of Control node does not clip children in all cases #37683
Comments
Probably happens because Node isn't a CanvasItem, right? |
Thanks for the reply. In regard to this information, am I right to assume, that this is intended behavior? |
Most likely yes, though I'm not a core contributor :) |
I would say this is an expected behavior. When you put an intermediate basic node in your hierarchy, this does reset the "transform inheritance" too. By that I mean that, in your example, the Tilemap node wont be positioned relatively to the Control node. So I guess it is kind of expected that the rect clipping works the same way. |
Thank you for confirming that this works as intended. Closing this issue accordingly. |
I would like to reopen this issue and suggest to resolve this by clarifying the documentation of rect_clip_content:
If approvable, I would like to create a pull request for this. |
@Sauermann Feel free to open a pull request for this 🙂 |
Will do. Line 841 in 047cdea
|
@Sauermann Yes, that's correct 🙂 |
…y CanvasItem based nodes. Resolves godotengine#37683
…y CanvasItem based nodes. Resolves godotengine#37683 (cherry picked from commit 3f19b5e)
Godot version: 3.2.1
OS/device including version: Windows 10
Issue description:
In some cases children and their children get displayed outside of the rect of the parent, even though rect_clip_content is set to true on the parent.
According to the documentation of the control class https://docs.godotengine.org/en/stable/classes/class_control.html#class-control-property-rect-clip-content I would expect, that all children get clipped within the bounds of the clipping parent.
This happens in the following setup:
Thank you for having a look at this issue.
Steps to reproduce:
Create a scene according to the described setup.
Add Tiles to the TileMap that are outside of the rect of the Control node.
Set rect_clip_content on the node Control to true.
The issue is visible in the editor and when the scene is run.
Workaround:
Change the type of Node to Control or Node2D.
Alternative solution:
Change the documentation of rect_clip_content and describe this behavior.
Minimal reproduction project:
ClipTileMapBug.zip
The text was updated successfully, but these errors were encountered: