Fixed issue #837. Valentina crashes when changing seam allowance on a curve

segment.

I made a mistake switching to C++11 range-based loops here.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-04-09 11:12:46 +03:00
parent 0281b5508c
commit f7e1b0942c

View File

@ -995,9 +995,9 @@ QVector<VSAPoint> VPiecePath::CurveSeamAllowanceSegment(const VContainer *data,
qreal w2 = end.GetSABefore(); qreal w2 = end.GetSABefore();
if (w1 < 0 && w2 < 0) if (w1 < 0 && w2 < 0)
{// no local widths {// no local widths
for(auto point : points) for(int i = 0; i < points.size(); ++i)
{ {
VSAPoint p(point); VSAPoint p(points.at(i));
if (i == 0) if (i == 0)
{ // first point { // first point
p.SetSAAfter(begin.GetSAAfter()); p.SetSAAfter(begin.GetSAAfter());
@ -1036,9 +1036,9 @@ QVector<VSAPoint> VPiecePath::CurveSeamAllowanceSegment(const VContainer *data,
qreal length = 0; // how much we handle qreal length = 0; // how much we handle
for(auto point : points) for(int i = 1; i < points.size(); ++i)
{ {
p = VSAPoint(point); p = VSAPoint(points.at(i));
if (i == points.size() - 1) if (i == points.size() - 1)
{// last point {// last point