PartDesign: fix the draggers for pad type and hole

This commit is contained in:
captain0xff
2025-09-03 00:27:17 +05:30
parent 341a239375
commit c55010d817
2 changed files with 10 additions and 2 deletions

View File

@@ -334,11 +334,13 @@ void TaskExtrudeParameters::connectSlots()
void TaskExtrudeParameters::onModeChanged_Side1(int index)
{
onModeChanged(index, Side::First);
setGizmoPositions();
}
void TaskExtrudeParameters::onModeChanged_Side2(int index)
{
onModeChanged(index, Side::Second);
setGizmoPositions();
}
void TaskExtrudeParameters::onSelectShapeFacesToggle(bool checked, Side side)
@@ -1391,17 +1393,21 @@ void TaskExtrudeParameters::setGizmoPositions()
PartDesign::TopoShape shape = extrude->getProfileShape();
Base::Vector3d center = getMidPointFromProfile(shape);
std::string sideType = std::string(extrude->SideType.getValueAsString());
std::string extrudeType = std::string(extrude->Type.getValueAsString());
std::string extrudeType2 = std::string(extrude->Type2.getValueAsString());
double dir = extrude->Reversed.getValue()? -1 : 1;
lengthGizmo1->Gizmo::setDraggerPlacement(center, extrude->Direction.getValue() * dir);
lengthGizmo1->setVisibility(extrudeType == "Length");
taperAngleGizmo1->placeOverLinearGizmo(lengthGizmo1);
taperAngleGizmo1->setVisibility(extrudeType == "Length");
lengthGizmo2->Gizmo::setDraggerPlacement(center, -extrude->Direction.getValue() * dir);
lengthGizmo2->setVisibility(
sideType == "Two sides"
sideType == "Two sides" && extrudeType2 == "Length"
);
taperAngleGizmo2->placeOverLinearGizmo(lengthGizmo2);
taperAngleGizmo2->setVisibility(
sideType == "Two sides"
sideType == "Two sides" && extrudeType2 == "Length"
);
Base::Vector3d padDir = extrude->Direction.getValue().Normalized();

View File

@@ -1250,6 +1250,8 @@ void TaskHoleParameters::setGizmoPositions()
holeDepthGizmo->setVisibility(
std::string(hole->DepthType.getValueAsString()) == "Dimension"
);
holeDepthGizmo->setDragLength(ui->Depth->rawValue());
}