From 294d07a2a05d8c069bffb00c822676cf8d0e3b07 Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Fri, 16 May 2025 23:49:19 +0800 Subject: [PATCH] Fix several crash when build in debug mode (#9650) * Fix crash when open bed shape dialog. DO NOT USE `auto` FOR EIGEN EXPRESSION RESULT! * Fix assertion failure when switching printer models --- src/slic3r/GUI/2DBed.cpp | 4 ++-- src/slic3r/GUI/Selection.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/2DBed.cpp b/src/slic3r/GUI/2DBed.cpp index dcfc5de9db..c30c2af81a 100644 --- a/src/slic3r/GUI/2DBed.cpp +++ b/src/slic3r/GUI/2DBed.cpp @@ -247,13 +247,13 @@ void Bed_2D::repaint(const std::vector& shape) // convert G - code coordinates into pixels Point Bed_2D::to_pixels(const Vec2d& point, int height) { - auto p = point * m_scale_factor + m_shift; + Vec2d p = point * m_scale_factor + m_shift; return Point(p(0) + Border, height - p(1) + Border); } Point Bed_2D::to_pixels(const Point& point, int height) { - auto p = point * m_scale_factor + Point(m_shift); + Point p = point * m_scale_factor + Point(m_shift); return Point(p(0) + Border, height - p(1) + Border); } diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp index 9b6d97443a..c456dfa1a1 100644 --- a/src/slic3r/GUI/Selection.cpp +++ b/src/slic3r/GUI/Selection.cpp @@ -1107,8 +1107,8 @@ const std::pair Selection::get_bounding_sphere() const using Min_sphere = CGAL::Min_sphere_of_spheres_d; using Point = K::Point_3; - std::vector points; - if (m_valid) { + if (m_valid && !m_list.empty()) { + std::vector points; for (unsigned int i : m_list) { const GLVolume& volume = *(*m_volumes)[i]; const TriangleMesh* hull = volume.convex_hull();