Fix 3D selection box size for Node3D

This commit is contained in:
Haoyu Qiu 2021-04-11 15:15:52 +08:00
parent d540875bc0
commit c8a40c8005
1 changed files with 3 additions and 3 deletions

View File

@ -3660,9 +3660,9 @@ Vector3 Node3DEditorViewport::_get_instance_position(const Point2 &p_pos) const
AABB Node3DEditorViewport::_calculate_spatial_bounds(const Node3D *p_parent, bool p_exclude_top_level_transform) {
AABB bounds;
const MeshInstance3D *mesh_instance = Object::cast_to<MeshInstance3D>(p_parent);
if (mesh_instance) {
bounds = mesh_instance->get_aabb();
const VisualInstance3D *visual_instance = Object::cast_to<VisualInstance3D>(p_parent);
if (visual_instance) {
bounds = visual_instance->get_aabb();
}
for (int i = 0; i < p_parent->get_child_count(); i++) {