Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Matena <lukasmatena@seznam.cz>2019-10-25 14:09:10 +0300
committerLukas Matena <lukasmatena@seznam.cz>2019-10-25 14:10:33 +0300
commit62c90abbc03887c7cf03297d3ec2c7c68ee15755 (patch)
tree0db2748c1d8a791194120556ea73b77e365ab37b /src
parent0986221fdcb6c8ebd26903e4491564dc63b504d4 (diff)
Fix of SPE-1041: set_state function for gizmos is called even if they are turned on/off by the undo/redo action
Diffstat (limited to 'src')
-rw-r--r--src/slic3r/GUI/Gizmos/GLGizmosManager.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.hpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.hpp
index f649c98b2..0defb1348 100644
--- a/src/slic3r/GUI/Gizmos/GLGizmosManager.hpp
+++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.hpp
@@ -114,8 +114,17 @@ public:
m_serializing = true;
+ // Following is needed to know which to be turn on, but not actually modify
+ // m_current prematurely, so activate_gizmo is not confused.
+ EType old_current = m_current;
ar(m_current);
+ EType new_current = m_current;
+ m_current = old_current;
+ // activate_gizmo call sets m_current and calls set_state for the gizmo
+ // it does nothing in case the gizmo is already activated
+ // it can safely be called for Undefined gizmo
+ activate_gizmo(new_current);
if (m_current != Undefined)
m_gizmos[m_current]->load(ar);
}