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
This commit is contained in:
Noisyfox
2025-05-16 23:49:19 +08:00
committed by GitHub
parent b7e0abc5f5
commit 294d07a2a0
2 changed files with 4 additions and 4 deletions

View File

@@ -247,13 +247,13 @@ void Bed_2D::repaint(const std::vector<Vec2d>& shape)
// convert G - code coordinates into pixels // convert G - code coordinates into pixels
Point Bed_2D::to_pixels(const Vec2d& point, int height) 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); return Point(p(0) + Border, height - p(1) + Border);
} }
Point Bed_2D::to_pixels(const Point& point, int height) 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); return Point(p(0) + Border, height - p(1) + Border);
} }

View File

@@ -1107,8 +1107,8 @@ const std::pair<Vec3d, double> Selection::get_bounding_sphere() const
using Min_sphere = CGAL::Min_sphere_of_spheres_d<Traits>; using Min_sphere = CGAL::Min_sphere_of_spheres_d<Traits>;
using Point = K::Point_3; using Point = K::Point_3;
if (m_valid && !m_list.empty()) {
std::vector<Point> points; std::vector<Point> points;
if (m_valid) {
for (unsigned int i : m_list) { for (unsigned int i : m_list) {
const GLVolume& volume = *(*m_volumes)[i]; const GLVolume& volume = *(*m_volumes)[i];
const TriangleMesh* hull = volume.convex_hull(); const TriangleMesh* hull = volume.convex_hull();