Allow equal angles for elliptical arc.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-01-05 19:42:28 +02:00
parent b25f971758
commit 55e0ef6549

View File

@ -268,14 +268,10 @@ void VToolEllipticalArc::SetFormulaF1(const VFormula &value)
{ {
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id); QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VEllipticalArc> elArc = qSharedPointerDynamicCast<VEllipticalArc>(obj); QSharedPointer<VEllipticalArc> elArc = qSharedPointerDynamicCast<VEllipticalArc>(obj);
if (not VFuzzyComparePossibleNulls(value.getDoubleValue(), elArc->GetEndAngle()))// Angles can't be equal
{
elArc->SetFormulaF1(value.GetFormula(FormulaType::FromUser), value.getDoubleValue()); elArc->SetFormulaF1(value.GetFormula(FormulaType::FromUser), value.getDoubleValue());
SaveOption(obj); SaveOption(obj);
} }
} }
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VFormula VToolEllipticalArc::GetFormulaF2() const VFormula VToolEllipticalArc::GetFormulaF2() const
@ -297,13 +293,10 @@ void VToolEllipticalArc::SetFormulaF2(const VFormula &value)
{ {
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id); QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VEllipticalArc> elArc = qSharedPointerDynamicCast<VEllipticalArc>(obj); QSharedPointer<VEllipticalArc> elArc = qSharedPointerDynamicCast<VEllipticalArc>(obj);
if (not VFuzzyComparePossibleNulls(value.getDoubleValue(), elArc->GetStartAngle()))// Angles can't be equal
{
elArc->SetFormulaF2(value.GetFormula(FormulaType::FromUser), value.getDoubleValue()); elArc->SetFormulaF2(value.GetFormula(FormulaType::FromUser), value.getDoubleValue());
SaveOption(obj); SaveOption(obj);
} }
} }
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VFormula VToolEllipticalArc::GetFormulaRotationAngle() const VFormula VToolEllipticalArc::GetFormulaRotationAngle() const