From eb389559b592d3f8d1eddcf5a9415470879fc78f Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 24 Nov 2021 10:24:11 +0100 Subject: [PATCH] Fixup of cc44089 (bed bounding box 2D vs 3D) The mentioned commit has changed behaviour of GLCanvas3D::get_size_proportional_to_max_bed_size(double) function so that it uses XYZ bounding box instead od just XY. As a result, adding a box object through the right panel added a huge box when printer max_print_z was higher than x/y. Offset at which a new object instance is added was also affected. --- src/slic3r/GUI/GLCanvas3D.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 1c7fc4a61..d5aee67ad 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3751,7 +3751,8 @@ Linef3 GLCanvas3D::mouse_ray(const Point& mouse_pos) double GLCanvas3D::get_size_proportional_to_max_bed_size(double factor) const { - return factor * m_bed.build_volume().bounding_volume().max_size(); + const BoundingBoxf& bbox = m_bed.build_volume().bounding_volume2d(); + return factor * std::max(bbox.size()[0], bbox.size()[1]); } void GLCanvas3D::set_cursor(ECursorType type)