From b47355a325800d4418a4b924637cc95253f58a71 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Tue, 29 Jan 2019 12:05:49 +0100 Subject: [PATCH] Added limit to zoom in --- src/slic3r/GUI/GLCanvas3D.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 7366516d1..5828c0e89 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -5951,6 +5951,9 @@ void GLCanvas3D::set_camera_zoom(float zoom) if (zoom_min > 0.0f) zoom = std::max(zoom, zoom_min * 0.7f); + // Don't allow to zoom too close to the scene. + zoom = std::min(zoom, 100.0f); + m_camera.zoom = zoom; viewport_changed(); _refresh_if_shown_on_screen();