Merge branch 'develop' into feature/manual-layout
This commit is contained in:
commit
e40f15ea35
|
@ -1,3 +1,6 @@
|
|||
# Valentina 0.7.48 (unreleased)
|
||||
- [smart-pattern/valentina#129] Incorrect behavior of empty arc and elliptical arc.
|
||||
|
||||
# Version 0.7.47 May 13, 2021
|
||||
- [smart-pattern/valentina#118] Incorrect seam allowance.
|
||||
- [smart-pattern/valentina#119] Improve tool Point of intersection curves.
|
||||
|
|
|
@ -117,6 +117,7 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
|
|||
}
|
||||
# endif
|
||||
|
||||
# if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
|
||||
// Hide Qt bug 'Assertion when reading an icns file'
|
||||
// https://bugreports.qt.io/browse/QTBUG-45537
|
||||
// Remove after Qt fix will be released
|
||||
|
@ -124,6 +125,13 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
|
|||
{
|
||||
type = QtDebugMsg;
|
||||
}
|
||||
# endif
|
||||
|
||||
// Hide anything that starts with QMacCGContext
|
||||
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QMacCGContext::")))
|
||||
{
|
||||
type = QtDebugMsg;
|
||||
}
|
||||
|
||||
// See issue #568
|
||||
if (msg.contains(QStringLiteral("Error receiving trust for a CA certificate")))
|
||||
|
|
|
@ -136,6 +136,7 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
|
|||
}
|
||||
# endif
|
||||
|
||||
# if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
|
||||
// Hide Qt bug 'Assertion when reading an icns file'
|
||||
// https://bugreports.qt.io/browse/QTBUG-45537
|
||||
// Remove after Qt fix will be released
|
||||
|
@ -143,6 +144,13 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
|
|||
{
|
||||
type = QtDebugMsg;
|
||||
}
|
||||
# endif
|
||||
|
||||
// Hide anything that starts with QMacCGContext
|
||||
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QMacCGContext::")))
|
||||
{
|
||||
type = QtDebugMsg;
|
||||
}
|
||||
|
||||
// See issue #568
|
||||
if (msg.contains(QStringLiteral("Error receiving trust for a CA certificate")))
|
||||
|
|
|
@ -263,6 +263,11 @@ QPointF VArc::GetP2 () const
|
|||
*/
|
||||
QVector<QPointF> VArc::GetPoints() const
|
||||
{
|
||||
if (qFuzzyIsNull(GetRadius()))
|
||||
{
|
||||
return {GetCenter().toQPointF()};
|
||||
}
|
||||
|
||||
QVector<QPointF> points;
|
||||
QVector<qreal> sectionAngle;
|
||||
|
||||
|
|
|
@ -493,12 +493,23 @@ qreal VEllipticalArc::MaxLength() const
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VEllipticalArc::GetP(qreal angle) const
|
||||
{
|
||||
if (qFuzzyIsNull(GetRadius1()) && qFuzzyIsNull(GetRadius2()))
|
||||
{
|
||||
return GetCenter().toQPointF();
|
||||
}
|
||||
|
||||
QLineF line(0, 0, 100, 0);
|
||||
line.setAngle(angle);
|
||||
|
||||
const qreal a = line.p2().x() / GetRadius1();
|
||||
const qreal b = line.p2().y() / GetRadius2();
|
||||
const qreal a = not qFuzzyIsNull(GetRadius1()) ? line.p2().x() / GetRadius1() : 0;
|
||||
const qreal b = not qFuzzyIsNull(GetRadius2()) ? line.p2().y() / GetRadius2() : 0;
|
||||
const qreal k = qSqrt(a*a + b*b);
|
||||
|
||||
if (qFuzzyIsNull(k))
|
||||
{
|
||||
return GetCenter().toQPointF();
|
||||
}
|
||||
|
||||
QPointF p(line.p2().x() / k, line.p2().y() / k);
|
||||
|
||||
QLineF line2(QPointF(), p);
|
||||
|
@ -565,6 +576,13 @@ void VEllipticalArc::SetFormulaRadius1(const QString &formula, qreal value)
|
|||
d->radius1 = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VEllipticalArc::SetRadius1(qreal value)
|
||||
{
|
||||
d->formulaRadius1 = QString::number(value);
|
||||
d->radius1 = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VEllipticalArc::SetFormulaRadius2(const QString &formula, qreal value)
|
||||
{
|
||||
|
@ -572,6 +590,13 @@ void VEllipticalArc::SetFormulaRadius2(const QString &formula, qreal value)
|
|||
d->radius2 = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VEllipticalArc::SetRadius2(qreal value)
|
||||
{
|
||||
d->formulaRadius2 = QString::number(value);
|
||||
d->radius2 = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VEllipticalArc::SetFormulaRotationAngle(const QString &formula, qreal value)
|
||||
{
|
||||
|
@ -579,6 +604,13 @@ void VEllipticalArc::SetFormulaRotationAngle(const QString &formula, qreal value
|
|||
d->rotationAngle = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VEllipticalArc::SetRotationAngle(qreal value)
|
||||
{
|
||||
d->formulaRotationAngle = QString::number(value);
|
||||
d->rotationAngle = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief GetRadius1 return elliptical arc major radius.
|
||||
|
|
|
@ -75,14 +75,17 @@ public:
|
|||
|
||||
QString GetFormulaRotationAngle () const;
|
||||
void SetFormulaRotationAngle (const QString &formula, qreal value);
|
||||
void SetRotationAngle(qreal value);
|
||||
qreal GetRotationAngle() const;
|
||||
|
||||
QString GetFormulaRadius1 () const;
|
||||
void SetFormulaRadius1 (const QString &formula, qreal value);
|
||||
void SetRadius1 (qreal value);
|
||||
qreal GetRadius1 () const;
|
||||
|
||||
QString GetFormulaRadius2 () const;
|
||||
void SetFormulaRadius2 (const QString &formula, qreal value);
|
||||
void SetRadius2 (qreal value);
|
||||
qreal GetRadius2 () const;
|
||||
|
||||
virtual qreal GetLength () const override;
|
||||
|
|
|
@ -456,3 +456,12 @@ void TST_VArc::TestCurveIntersectAxis()
|
|||
|
||||
Comparison(intersectionPoint, crosPoint, accuracyPointOnLine);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_VArc::EmptyArc()
|
||||
{
|
||||
VArc empty;
|
||||
|
||||
Comparison(empty.GetPoints(), {QPointF()});
|
||||
QCOMPARE(empty.GetLength(), 0.);
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ private slots:
|
|||
void TestCutArc();
|
||||
void TestCurveIntersectAxis_data();
|
||||
void TestCurveIntersectAxis();
|
||||
void EmptyArc();
|
||||
};
|
||||
|
||||
#endif // TST_VARC_H
|
||||
|
|
|
@ -577,3 +577,29 @@ void TST_VEllipticalArc::TestFlip()
|
|||
QCOMPARE(elArc.GetRadius1(), res.GetRadius1());
|
||||
QCOMPARE(elArc.GetRadius2(), res.GetRadius2());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_VEllipticalArc::EmptyArc_data()
|
||||
{
|
||||
QTest::addColumn<qreal>("radius1");
|
||||
QTest::addColumn<qreal>("radius2");
|
||||
QTest::addColumn<qreal>("length");
|
||||
|
||||
QTest::newRow("Empty elArc") << 0. << 0. << 0.;
|
||||
QTest::newRow("Radius1 correct") << 50. << 0. << 50.*4;
|
||||
QTest::newRow("Radius2 correct") << 0. << 30. << 30.*4;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_VEllipticalArc::EmptyArc()
|
||||
{
|
||||
QFETCH(qreal, radius1);
|
||||
QFETCH(qreal, radius2);
|
||||
QFETCH(qreal, length);
|
||||
|
||||
VEllipticalArc empty;
|
||||
empty.SetRadius1(radius1);
|
||||
empty.SetRadius2(radius2);
|
||||
|
||||
QCOMPARE(empty.GetLength(), length);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,8 @@ private slots:
|
|||
void TestRotation();
|
||||
void TestFlip_data();
|
||||
void TestFlip();
|
||||
void EmptyArc_data();
|
||||
void EmptyArc();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(TST_VEllipticalArc)
|
||||
|
|
Loading…
Reference in New Issue
Block a user