You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Remove unnecessary casts
button_add_item and button_add are both Button p_parent is a Node3D CanvasItem can never be cast to Viewport
This commit is contained in:
@@ -3781,7 +3781,7 @@ AABB Node3DEditorViewport::_calculate_spatial_bounds(const Node3D *p_parent, boo
|
||||
if (child) {
|
||||
AABB child_bounds = _calculate_spatial_bounds(child, false);
|
||||
|
||||
if (bounds.size == Vector3() && Object::cast_to<Node3D>(p_parent)) {
|
||||
if (bounds.size == Vector3() && p_parent) {
|
||||
bounds = child_bounds;
|
||||
} else {
|
||||
bounds.merge_with(child_bounds);
|
||||
@@ -3789,7 +3789,7 @@ AABB Node3DEditorViewport::_calculate_spatial_bounds(const Node3D *p_parent, boo
|
||||
}
|
||||
}
|
||||
|
||||
if (bounds.size == Vector3() && !Object::cast_to<Node3D>(p_parent)) {
|
||||
if (bounds.size == Vector3() && !p_parent) {
|
||||
bounds = AABB(Vector3(-0.2, -0.2, -0.2), Vector3(0.4, 0.4, 0.4));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user