You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Fix CanvasItem search for a CanvasLayer
This fixes the situation where a `CanvasItem` descendant of a `Viewport` which in turn is a descendant of a `CanvasLayer` prefers the more outer `CanvasLayer` rather than the `Vierport`'s. Because of that, `CanvasItem`s inside a `Viewport` inside a `CanvasLayer` were being rendered to the main `Viewport` instead of the render target of the innermost one.
This commit is contained in:
@@ -411,6 +411,9 @@ void CanvasItem::_enter_canvas() {
|
||||
if (canvas_layer) {
|
||||
break;
|
||||
}
|
||||
if (Object::cast_to<Viewport>(n)) {
|
||||
break;
|
||||
}
|
||||
n = n->get_parent();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user