Merge pull request #84856 from mihe/fix-block-transform-notify

Fix transform notification not getting sent out for RigidBody2D
This commit is contained in:
Rémi Verschelde 2023-11-14 19:31:43 +01:00
commit 9c67a02259
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -891,22 +891,18 @@ void CanvasItem::_notify_transform(CanvasItem *p_node) {
* notification anyway).
*/
if (/*p_node->xform_change.in_list() &&*/ p_node->_is_global_invalid()) {
if (p_node->block_transform_notify || p_node->_is_global_invalid()) {
return; //nothing to do
}
p_node->_set_global_invalid(true);
if (p_node->notify_transform && !p_node->xform_change.in_list()) {
if (!p_node->block_transform_notify) {
if (p_node->is_inside_tree()) {
if (is_accessible_from_caller_thread()) {
get_tree()->xform_change_list.add(&p_node->xform_change);
} else {
// Should be rare, but still needs to be handled.
MessageQueue::get_singleton()->push_callable(callable_mp(p_node, &CanvasItem::_notify_transform_deferred));
}
}
if (p_node->notify_transform && !p_node->xform_change.in_list() && p_node->is_inside_tree()) {
if (is_accessible_from_caller_thread()) {
get_tree()->xform_change_list.add(&p_node->xform_change);
} else {
// Should be rare, but still needs to be handled.
MessageQueue::get_singleton()->push_callable(callable_mp(p_node, &CanvasItem::_notify_transform_deferred));
}
}