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:
parent
b538254b18
commit
49d0af3c8e
1 changed files with 3 additions and 0 deletions
|
@ -411,6 +411,9 @@ void CanvasItem::_enter_canvas() {
|
||||||
if (canvas_layer) {
|
if (canvas_layer) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (Object::cast_to<Viewport>(n)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
n = n->get_parent();
|
n = n->get_parent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue