diff --git a/src/Gui/Inventor/Draggers/Gizmo.cpp b/src/Gui/Inventor/Draggers/Gizmo.cpp index b8bf4e47d4..7a27ebdacb 100644 --- a/src/Gui/Inventor/Draggers/Gizmo.cpp +++ b/src/Gui/Inventor/Draggers/Gizmo.cpp @@ -88,7 +88,7 @@ bool Gizmo::getVisibility() { LinearGizmo::LinearGizmo(QuantitySpinBox* property) { - setProperty(property); + this->property = property; } SoInteractionKit* LinearGizmo::initDragger() @@ -118,8 +118,6 @@ SoInteractionKit* LinearGizmo::initDragger() dragger->labelVisible = false; - setDragLength(property->value().getValue()); - dragger->instantiateBaseGeometry(); // change the dragger dimensions @@ -129,6 +127,8 @@ SoInteractionKit* LinearGizmo::initDragger() updateColorTheme(); + setProperty(property); + return draggerContainer; } @@ -170,7 +170,6 @@ void LinearGizmo::reverseDir() { getDraggerContainer()->setPointerDirection(dir * -1); } - double LinearGizmo::getDragLength() { double dragLength = dragger->translationIncrementCount.getValue() @@ -217,6 +216,10 @@ void LinearGizmo::setProperty(QuantitySpinBox* property) setVisibility(visible); } ); + + // Updates the gizmo state based on the new property + setDragLength(property->rawValue()); + setVisibility(visible); } void LinearGizmo::setMultFactor(const double val) @@ -269,7 +272,7 @@ void LinearGizmo::draggingContinued() RotationGizmo::RotationGizmo(QuantitySpinBox* property) { - setProperty(property); + this->property = property; } RotationGizmo::~RotationGizmo() @@ -312,7 +315,7 @@ SoInteractionKit* RotationGizmo::initDragger() this ); - setRotAngle(property->value().getValue()); + setProperty(property); updateColorTheme(); @@ -502,6 +505,10 @@ void RotationGizmo::setProperty(QuantitySpinBox* property) setVisibility(visible); } ); + + // Updates the gizmo state based on the new property + setRotAngle(property->rawValue()); + setVisibility(visible); } void RotationGizmo::setMultFactor(const double val) diff --git a/src/Mod/PartDesign/Gui/TaskChamferParameters.cpp b/src/Mod/PartDesign/Gui/TaskChamferParameters.cpp index ec7af40633..d991a08380 100644 --- a/src/Mod/PartDesign/Gui/TaskChamferParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskChamferParameters.cpp @@ -367,7 +367,6 @@ void TaskChamferParameters::setupGizmos(ViewProviderDressUp* vp) angleGizmo->setVisibility(false); secondDistanceGizmo->setProperty(ui->chamferSize); - secondDistanceGizmo->setDragLength(ui->chamferSize->value().getValue()); break; case Part::ChamferType::twoDistances: @@ -375,7 +374,6 @@ void TaskChamferParameters::setupGizmos(ViewProviderDressUp* vp) angleGizmo->setVisibility(false); secondDistanceGizmo->setProperty(ui->chamferSize2); - secondDistanceGizmo->setDragLength(ui->chamferSize2->value().getValue()); break; case Part::ChamferType::distanceAngle: