mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 09:46:05 +08:00
Fix incorrect clamping of bounding box in GLCanvas3D::_max_bounding_box()
This commit is contained in:
parent
7831b4bd07
commit
b8a1ead9f3
@ -5380,9 +5380,10 @@ BoundingBoxf3 GLCanvas3D::_max_bounding_box(bool include_gizmos, bool include_be
|
||||
static const double max_scale_factor = 2.0;
|
||||
const Vec3d bb_size = bb.size();
|
||||
const Vec3d bed_bb_size = m_bed.build_volume().bounding_volume().size();
|
||||
if (bb_size.x() > max_scale_factor * bed_bb_size.x() ||
|
||||
bb_size.y() > max_scale_factor * bed_bb_size.y() ||
|
||||
bb_size.z() > max_scale_factor * bed_bb_size.z()) {
|
||||
|
||||
if ((bed_bb_size.x() > 0.0 && bb_size.x() > max_scale_factor * bed_bb_size.x()) ||
|
||||
(bed_bb_size.y() > 0.0 && bb_size.y() > max_scale_factor * bed_bb_size.y()) ||
|
||||
(bed_bb_size.z() > 0.0 && bb_size.z() > max_scale_factor * bed_bb_size.z())) {
|
||||
const Vec3d bed_bb_center = bed_bb.center();
|
||||
const Vec3d extend_by = max_scale_factor * bed_bb_size;
|
||||
bb = BoundingBoxf3(bed_bb_center - extend_by, bed_bb_center + extend_by);
|
||||
|
Loading…
x
Reference in New Issue
Block a user