diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 70b29d9a7..5c80bac59 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -4206,6 +4206,9 @@ unsigned int GLCanvas3D::get_volumes_count() const void GLCanvas3D::reset_volumes() { + if (!m_initialized) + return; + _set_current(); if (!m_volumes.empty()) @@ -4254,6 +4257,7 @@ void GLCanvas3D::set_bed_shape(const Pointfs& shape) // Set the origin and size for painting of the coordinate system axes. m_axes.origin = Vec3d(0.0, 0.0, (double)GROUND_Z); set_bed_axes_length(0.1 * m_bed.get_bounding_box().max_size()); + m_camera.set_scene_box(scene_bounding_box(), *this); m_requires_zoom_to_bed = true; m_dirty = true; @@ -4688,7 +4692,8 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re if ((m_canvas == nullptr) || (m_config == nullptr) || (m_model == nullptr)) return; - _set_current(); + if (m_initialized) + _set_current(); struct ModelVolumeState { ModelVolumeState(const GLVolume *volume) : @@ -5748,8 +5753,11 @@ Point GLCanvas3D::get_local_mouse_position() const void GLCanvas3D::reset_legend_texture() { - _set_current(); - m_legend_texture.reset(); + if (m_legend_texture.get_id() != 0) + { + _set_current(); + m_legend_texture.reset(); + } } void GLCanvas3D::set_tooltip(const std::string& tooltip) const diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index b06bde411..0ad6c3562 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -419,10 +419,6 @@ void Preview::reload_print(bool force) m_canvas->reset_legend_texture(); m_loaded = false; -#if ENABLE_REWORKED_BED_SHAPE_CHANGE - m_canvas->set_bed_shape(dynamic_cast(m_config->option("bed_shape"))->values); -#endif // ENABLE_REWORKED_BED_SHAPE_CHANGE - if (!IsShown() && !force) return;