Fixed issues introduced in #3456

- Copy-paste error when setting angle dimensions.
- Max angle limit set to 180 degrees.
This commit is contained in:
Armandas Jarušauskas
2020-05-12 12:14:51 +09:00
committed by wwmayer
parent facefa8f46
commit be82131803
3 changed files with 6 additions and 6 deletions

View File

@@ -53,7 +53,7 @@ using namespace PartDesign;
PROPERTY_SOURCE(PartDesign::Chamfer, PartDesign::DressUp)
const App::PropertyQuantityConstraint::Constraints floatSize = {0.0,FLT_MAX,0.1};
const App::PropertyAngle::Constraints floatAngle = {0.0,89.99,0.1};
const App::PropertyAngle::Constraints floatAngle = {0.0,180.0,0.1};
Chamfer::Chamfer()
{
@@ -61,7 +61,7 @@ Chamfer::Chamfer()
Size.setUnit(Base::Unit::Length);
Size.setConstraints(&floatSize);
ADD_PROPERTY(Angle,(45.0));
Size.setUnit(Base::Unit::Angle);
Angle.setUnit(Base::Unit::Angle);
Angle.setConstraints(&floatAngle);
}
@@ -94,8 +94,8 @@ App::DocumentObjectExecReturn *Chamfer::execute(void)
return new App::DocumentObjectExecReturn("Size must be greater than zero");
double angle = Base::toRadians(Angle.getValue());
if (angle <= 0 || angle > 89.99)
return new App::DocumentObjectExecReturn("Angle must be between 0 and 89.99");
if (angle <= 0 || angle >= 180.0)
return new App::DocumentObjectExecReturn("Angle must be greater than 0 and less than 180");
this->positionByBaseFeature();
// create an untransformed copy of the basefeature shape

View File

@@ -76,7 +76,7 @@ TaskChamferParameters::TaskChamferParameters(ViewProviderDressUp *DressUpView, Q
ui->chamferAngle->setUnit(Base::Unit::Angle);
ui->chamferAngle->setValue(a);
ui->chamferAngle->setMinimum(0.0);
ui->chamferAngle->setMaximum(89.99);
ui->chamferAngle->setMaximum(180.0);
ui->chamferAngle->selectAll();
ui->chamferAngle->bind(pcChamfer->Angle);
QMetaObject::invokeMethod(ui->chamferAngle, "setFocus", Qt::QueuedConnection);

View File

@@ -89,7 +89,7 @@ click again to end selection</string>
<double>0.000000000000000</double>
</property>
<property name="maximum" stdset="0">
<double>89.999999999999986</double>
<double>180.000000000000000</double>
</property>
<property name="singleStep" stdset="0">
<double>0.100000000000000</double>