Skip to content

CanvasItem shows despite not visible in tree #58388

Closed
@KoBeWi

Description

Godot version

3.x 4e44a15 / 4.0 adf1090

System information

W10

Issue description

When you have any CanvasItem directly under CanvasLayer, make the layer invisible and then toggle that item's visibility twice, it will appear and also makes the whole branch appear:

What's weird about this is that _update_callback() is not called and the visibility isn't propagated in any way, so this is something related to CanvasLayers and directly to RenderingServer. It doesn't happen for nodes under other CanvasItem.

EDIT:
I didn't really investigate it, but the fact that the bug happens with CanvasLayer and not with CanvasItem suggests that somewhere in RenderingServer, or at whatever part of code is responsible for drawing, there is a condition that checks whether parent CanvasItem is visible and for any other class it just assumes true. So this code would need to handle also CanvasLayers.

Steps to reproduce

  1. Add CanvasLayer
  2. Add Sprite2D under the layer
  3. Make layer invisible
  4. Toggle Sprite2D visibility twice

Minimal reproduction project

No response

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions