Fix of a crash when setting a viewport over an empty platter.

Exported bounding box 'empty' method to perl.
This commit is contained in:
bubnikv 2016-10-18 16:44:05 +02:00
parent 26349b30c5
commit 53907a9cfe
4 changed files with 18 additions and 11 deletions

View file

@ -102,13 +102,13 @@ inline bool operator!=(const BoundingBoxBase<VT> &bb1, const BoundingBoxBase<VT>
template<typename VT>
inline bool empty(const BoundingBoxBase<VT> &bb)
{
return bb.min.x > bb.max.x || bb.min.y > bb.max.y;
return ! bb.defined || bb.min.x > bb.max.x || bb.min.y > bb.max.y;
}
template<typename VT>
inline bool empty(const BoundingBox3Base<VT> &bb)
{
return bb.min.x > bb.max.x || bb.min.y > bb.max.y || bb.min.z > bb.max.z;
return ! bb.defined || bb.min.x > bb.max.x || bb.min.y > bb.max.y || bb.min.z > bb.max.z;
}
} // namespace Slic3r