From d5ec53f30de05721e78a0b5de3c67f99c79c7786 Mon Sep 17 00:00:00 2001 From: captain0xff Date: Mon, 1 Sep 2025 23:20:18 +0530 Subject: [PATCH 1/2] PartDesign: fix draggers for chamfer with two dimensions --- src/Gui/Inventor/Draggers/Gizmo.cpp | 14 ++++++-------- src/Gui/Inventor/Draggers/Gizmo.h | 3 ++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Gui/Inventor/Draggers/Gizmo.cpp b/src/Gui/Inventor/Draggers/Gizmo.cpp index ad6bba3988..81f3e020aa 100644 --- a/src/Gui/Inventor/Draggers/Gizmo.cpp +++ b/src/Gui/Inventor/Draggers/Gizmo.cpp @@ -178,9 +178,8 @@ SoLinearDraggerContainer* LinearGizmo::getDraggerContainer() void LinearGizmo::setProperty(QuantitySpinBox* property) { - if (quantityChangedConnection) { - QuantitySpinBox::disconnect(quantityChangedConnection); - } + QuantitySpinBox::disconnect(quantityChangedConnection); + QuantitySpinBox::disconnect(formulaDialogConnection); this->property = property; quantityChangedConnection = QuantitySpinBox::connect( @@ -189,7 +188,7 @@ void LinearGizmo::setProperty(QuantitySpinBox* property) setDragLength(value); } ); - quantityChangedConnection = QuantitySpinBox::connect( + formulaDialogConnection = QuantitySpinBox::connect( property, &Gui::QuantitySpinBox::showFormulaDialog, [this] (bool) { // This will set the visibility of the actual geometry to true or false @@ -452,9 +451,8 @@ void RotationGizmo::orientAlongCamera(SoCamera* camera) void RotationGizmo::setProperty(QuantitySpinBox* property) { - if (quantityChangedConnection) { - QuantitySpinBox::disconnect(quantityChangedConnection); - } + QuantitySpinBox::disconnect(quantityChangedConnection); + QuantitySpinBox::disconnect(formulaDialogConnection); this->property = property; quantityChangedConnection = QuantitySpinBox::connect( @@ -463,7 +461,7 @@ void RotationGizmo::setProperty(QuantitySpinBox* property) setRotAngle(value); } ); - quantityChangedConnection = QuantitySpinBox::connect( + formulaDialogConnection = QuantitySpinBox::connect( property, &Gui::QuantitySpinBox::showFormulaDialog, [this] (bool) { // This will set the visibility of the actual geometry to true or false diff --git a/src/Gui/Inventor/Draggers/Gizmo.h b/src/Gui/Inventor/Draggers/Gizmo.h index a87a98ff19..9a7dc8e5f1 100644 --- a/src/Gui/Inventor/Draggers/Gizmo.h +++ b/src/Gui/Inventor/Draggers/Gizmo.h @@ -85,7 +85,6 @@ protected: double initialValue; bool visible = true; - bool hasExpression = false; }; class GuiExport LinearGizmo: public Gizmo @@ -115,6 +114,7 @@ private: SoLinearDragger* dragger = nullptr; SoLinearDraggerContainer* draggerContainer = nullptr; QMetaObject::Connection quantityChangedConnection; + QMetaObject::Connection formulaDialogConnection; void draggingStarted(); void draggingFinished(); @@ -160,6 +160,7 @@ private: LinearGizmo* linearGizmo = nullptr; bool automaticOrientation = false; QMetaObject::Connection quantityChangedConnection; + QMetaObject::Connection formulaDialogConnection; void draggingStarted(); void draggingFinished(); From 4c75c3fe0a3a5c5e8191e25471a6d52cbe769f7a Mon Sep 17 00:00:00 2001 From: captain0xff Date: Tue, 2 Sep 2025 00:32:25 +0530 Subject: [PATCH 2/2] PartDesign: set the linear dragger increment based on the zoom level --- src/Gui/Inventor/Draggers/Gizmo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Gui/Inventor/Draggers/Gizmo.cpp b/src/Gui/Inventor/Draggers/Gizmo.cpp index 81f3e020aa..5e18462ea2 100644 --- a/src/Gui/Inventor/Draggers/Gizmo.cpp +++ b/src/Gui/Inventor/Draggers/Gizmo.cpp @@ -26,6 +26,8 @@ #include "Gizmo.h" #ifndef _PreComp_ +#include + #include #include #include @@ -168,6 +170,7 @@ void LinearGizmo::setDragLength(double dragLength) void LinearGizmo::setGeometryScale(float scale) { dragger->geometryScale = SbVec3f(scale, scale, scale); + dragger->translationIncrement = std::pow(10.0f, std::floor(std::log10(scale))); } SoLinearDraggerContainer* LinearGizmo::getDraggerContainer()