diff --git a/ChangeLog.txt b/ChangeLog.txt index 15028da9c..e9b004218 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,7 +7,9 @@ - [#325] Check pattern for inverse compatibility. # Version 0.4.2 -- Fixed triggering validation a detail. Two new cases: has been changed Reverse option and the list has been scrolled. +- Fixed getting correct reversed segment for single in the list curve. +- Fixed triggering validation a detail. Two new cases: has been changed Reverse option and the list +has been scrolled. Fixed validation when the list conatains only curve. - Fixed broken path to measurements after using Save As option. - Tool line. Block selecting the same point twice. - [#443] Not valid dxf file. libdxf updated to version 3.12.2.0. Fixed drawing subpaths. diff --git a/src/libs/vpatterndb/vdetail.cpp b/src/libs/vpatterndb/vdetail.cpp index 05d123893..3c09862e0 100644 --- a/src/libs/vpatterndb/vdetail.cpp +++ b/src/libs/vpatterndb/vdetail.cpp @@ -371,8 +371,8 @@ QVector VDetail::ContourPoints(const VContainer *data) const { const QSharedPointer curve = data->GeometricObject(at(i).getId()); - const QPointF begin = StartSegment(data, i); - const QPointF end = EndSegment(data, i); + const QPointF begin = StartSegment(data, i, at(i).getReverse()); + const QPointF end = EndSegment(data, i, at(i).getReverse()); points << curve->GetSegmentPoints(begin, end, at(i).getReverse()); } @@ -415,8 +415,8 @@ QVector VDetail::SeamAllowancePoints(const VContainer *data) const { const QSharedPointer curve = data->GeometricObject(at(i).getId()); - const QPointF begin = StartSegment(data, i); - const QPointF end = EndSegment(data, i); + const QPointF begin = StartSegment(data, i, at(i).getReverse()); + const QPointF end = EndSegment(data, i, at(i).getReverse()); const QVector nodePoints = curve->GetSegmentPoints(begin, end, at(i).getReverse()); pointsEkv << biasPoints(nodePoints, at(i).getMx(), at(i).getMy()); @@ -524,7 +524,7 @@ int VDetail::indexOfNode(const QVector &list, const quint32 &id) } //--------------------------------------------------------------------------------------------------------------------- -QPointF VDetail::StartSegment(const VContainer *data, const int &i) const +QPointF VDetail::StartSegment(const VContainer *data, const int &i, bool reverse) const { if (i < 0 && i > CountNode()-1) { @@ -533,7 +533,13 @@ QPointF VDetail::StartSegment(const VContainer *data, const int &i) const const QSharedPointer curve = data->GeometricObject(at(i).getId()); - QPointF begin = curve->GetPoints().first(); + QVector points = curve->GetPoints(); + if (reverse) + { + points = VGObject::GetReversePoints(points); + } + + QPointF begin = points.first(); if (CountNode() > 1) { if (i == 0) @@ -555,7 +561,7 @@ QPointF VDetail::StartSegment(const VContainer *data, const int &i) const } //--------------------------------------------------------------------------------------------------------------------- -QPointF VDetail::EndSegment(const VContainer *data, const int &i) const +QPointF VDetail::EndSegment(const VContainer *data, const int &i, bool reverse) const { if (i < 0 && i > CountNode()-1) { @@ -564,7 +570,13 @@ QPointF VDetail::EndSegment(const VContainer *data, const int &i) const const QSharedPointer curve = data->GeometricObject(at(i).getId()); - QPointF end = curve->GetPoints().last(); + QVector points = curve->GetPoints(); + if (reverse) + { + points = VGObject::GetReversePoints(points); + } + + QPointF end = points.last(); if (CountNode() > 2) { if (i == CountNode() - 1) diff --git a/src/libs/vpatterndb/vdetail.h b/src/libs/vpatterndb/vdetail.h index aa7262342..ae72e2b94 100644 --- a/src/libs/vpatterndb/vdetail.h +++ b/src/libs/vpatterndb/vdetail.h @@ -89,8 +89,8 @@ private: static int indexOfNode(const QVector &list, const quint32 &id); - QPointF StartSegment(const VContainer *data, const int &i) const; - QPointF EndSegment(const VContainer *data, const int &i) const; + QPointF StartSegment(const VContainer *data, const int &i, bool reverse) const; + QPointF EndSegment(const VContainer *data, const int &i, bool reverse) const; static QVector biasPoints(const QVector &points, const qreal &mx, const qreal &my); };