mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 20:36:53 +01:00
Fix CanvasItem
not exiting its canvas group on canvas exit
This commit is contained in:
parent
dfd8e09953
commit
0d8a6b6cdd
@ -537,16 +537,16 @@ void CanvasItem::_enter_canvas() {
|
||||
|
||||
VisualServer::get_singleton()->canvas_item_set_parent(canvas_item, canvas);
|
||||
|
||||
group = "root_canvas" + itos(canvas.get_id());
|
||||
canvas_group = "root_canvas" + itos(canvas.get_id());
|
||||
|
||||
add_to_group(group);
|
||||
add_to_group(canvas_group);
|
||||
if (canvas_layer) {
|
||||
canvas_layer->reset_sort_index();
|
||||
} else {
|
||||
get_viewport()->gui_reset_canvas_sort_index();
|
||||
}
|
||||
|
||||
get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE, group, "_toplevel_raise_self");
|
||||
get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE, canvas_group, "_toplevel_raise_self");
|
||||
|
||||
} else {
|
||||
CanvasItem *parent = get_parent_item();
|
||||
@ -565,7 +565,10 @@ void CanvasItem::_exit_canvas() {
|
||||
notification(NOTIFICATION_EXIT_CANVAS, true); //reverse the notification
|
||||
VisualServer::get_singleton()->canvas_item_set_parent(canvas_item, RID());
|
||||
canvas_layer = nullptr;
|
||||
group = "";
|
||||
if (canvas_group != "") {
|
||||
remove_from_group(canvas_group);
|
||||
canvas_group = "";
|
||||
}
|
||||
}
|
||||
|
||||
void CanvasItem::_notification(int p_what) {
|
||||
@ -591,8 +594,8 @@ void CanvasItem::_notification(int p_what) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (group != "") {
|
||||
get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE, group, "_toplevel_raise_self");
|
||||
if (canvas_group != "") {
|
||||
get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE, canvas_group, "_toplevel_raise_self");
|
||||
} else {
|
||||
CanvasItem *p = get_parent_item();
|
||||
ERR_FAIL_COND(!p);
|
||||
|
@ -175,7 +175,7 @@ private:
|
||||
mutable SelfList<Node> xform_change;
|
||||
|
||||
RID canvas_item;
|
||||
String group;
|
||||
String canvas_group;
|
||||
|
||||
CanvasLayer *canvas_layer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user