From d845332de1e393e7a0d7f37379f6de0a31b4ee82 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 26 Jun 2019 11:49:02 +0200 Subject: [PATCH] Fixed a crash when using place to bed function with the layer editing active This was caused by trying to render a deleted layer height profile. Other gizmos were not affected because they are not dragging at the time of their action, so the profile was correctly recalculated for them. --- src/slic3r/GUI/GLCanvas3D.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index c828e0ec66..bed3b754b3 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -457,8 +457,10 @@ void GLCanvas3D::LayersEditing::_render_profile(const Rect& bar_rect) const { //FIXME show some kind of legend. + if (!m_slicing_parameters) + return; + // Make the vertical bar a bit wider so the layer height curve does not touch the edge of the bar region. - assert(m_slicing_parameters != nullptr); float scale_x = bar_rect.get_width() / (float)(1.12 * m_slicing_parameters->max_layer_height); float scale_y = bar_rect.get_height() / m_object_max_z; float x = bar_rect.get_left() + (float)m_slicing_parameters->layer_height * scale_x;