From ad245a0021c551a6ce467b8110c83327a57bb492 Mon Sep 17 00:00:00 2001
From: Enrico Turri <enricoturri@seznam.cz>
Date: Thu, 10 Jan 2019 14:43:07 +0100
Subject: [PATCH] Deactivate current gizmo if user delete all objects from the
 scene

---
 src/slic3r/GUI/GLCanvas3D.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp
index 3a4cc0175..ad59ad8c5 100644
--- a/src/slic3r/GUI/GLCanvas3D.cpp
+++ b/src/slic3r/GUI/GLCanvas3D.cpp
@@ -4675,6 +4675,11 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
     m_camera.set_scene_box(scene_bounding_box(), *this);
     m_camera.set_target(m_camera.get_target(), *this);
 
+    // if no object is selected, deactivate active gizmo, if any
+    // otherwise it will be shown after cleaning the scene (while it is active)
+    if (m_selection.is_empty())
+        m_gizmos.reset_all_states();
+
     // and force this canvas to be redrawn.
     m_dirty = true;
 }