mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 02:07:54 -06:00
Fixed a crash when switching to Preview
This commit is contained in:
parent
d3bb966f4d
commit
3e15d22f35
2 changed files with 5 additions and 3 deletions
|
@ -73,8 +73,9 @@ Raycaster* CommonGizmosDataPool::raycaster() const
|
||||||
ObjectClipper* CommonGizmosDataPool::object_clipper() const
|
ObjectClipper* CommonGizmosDataPool::object_clipper() const
|
||||||
{
|
{
|
||||||
ObjectClipper* oc = dynamic_cast<ObjectClipper*>(m_data.at(CommonGizmosDataID::ObjectClipper).get());
|
ObjectClipper* oc = dynamic_cast<ObjectClipper*>(m_data.at(CommonGizmosDataID::ObjectClipper).get());
|
||||||
assert(oc);
|
// ObjectClipper is used from outside the gizmos to report current clipping plane.
|
||||||
return oc->is_valid() ? oc : nullptr;
|
// This function can be called when oc is nullptr.
|
||||||
|
return (oc && oc->is_valid()) ? oc : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
SupportsClipper* CommonGizmosDataPool::supports_clipper() const
|
SupportsClipper* CommonGizmosDataPool::supports_clipper() const
|
||||||
|
|
|
@ -412,7 +412,8 @@ bool GLGizmosManager::gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_p
|
||||||
|
|
||||||
ClippingPlane GLGizmosManager::get_clipping_plane() const
|
ClippingPlane GLGizmosManager::get_clipping_plane() const
|
||||||
{
|
{
|
||||||
if (! m_common_gizmos_data->object_clipper()
|
if (! m_common_gizmos_data
|
||||||
|
|| ! m_common_gizmos_data->object_clipper()
|
||||||
|| m_common_gizmos_data->object_clipper()->get_position() == 0.)
|
|| m_common_gizmos_data->object_clipper()->get_position() == 0.)
|
||||||
return ClippingPlane::ClipsNothing();
|
return ClippingPlane::ClipsNothing();
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue