Skip to content

Commit

Permalink
Prevent infinite recursion in first _draw
Browse files Browse the repository at this point in the history
Caused by size changes fired in some cases, mainly by auto-translation,
and due to that `_redraw_callback` is called from a flush causing any
queued methods to be fired immediately.
  • Loading branch information
AThousandShips committed Sep 22, 2024
1 parent e4e024a commit 4131cfa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scene/main/canvas_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ void CanvasItem::_enter_canvas() {
}
}

pending_update = false;
queue_redraw();

notification(NOTIFICATION_ENTER_CANVAS);
Expand All @@ -273,6 +272,8 @@ void CanvasItem::_exit_canvas() {
remove_from_group(canvas_group);
canvas_group = StringName();
}
// Clear pending update in case node is manipulated during a _draw call.
pending_update = false;
}

void CanvasItem::_notification(int p_what) {
Expand Down

0 comments on commit 4131cfa

Please sign in to comment.