Merge pull request #11674 from marcelofg55/master
Prevent a possible crash when exporting to MeshLibrary
This commit is contained in:
commit
4b57e078ae
1 changed files with 3 additions and 1 deletions
|
@ -112,8 +112,10 @@ Vector<Ref<Texture> > EditorInterface::make_mesh_previews(const Vector<Ref<Mesh>
|
||||||
Rect3 rot_aabb = xform.xform(aabb);
|
Rect3 rot_aabb = xform.xform(aabb);
|
||||||
print_line("rot_aabb: " + rot_aabb);
|
print_line("rot_aabb: " + rot_aabb);
|
||||||
float m = MAX(rot_aabb.size.x, rot_aabb.size.y) * 0.5;
|
float m = MAX(rot_aabb.size.x, rot_aabb.size.y) * 0.5;
|
||||||
if (m == 0)
|
if (m == 0) {
|
||||||
|
textures.push_back(Ref<Texture>());
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
m = 1.0 / m;
|
m = 1.0 / m;
|
||||||
m *= 0.5;
|
m *= 0.5;
|
||||||
print_line("scale: " + rtos(m));
|
print_line("scale: " + rtos(m));
|
||||||
|
|
Loading…
Reference in a new issue