Do not round a piece data when export.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-07-21 14:31:47 +03:00
parent a6976fd1ee
commit 51f89c9799

View File

@ -298,16 +298,6 @@ QVector<QPointF> CorrectPosition(const QRectF &parentBoundingRect, QVector<QPoin
return points; return points;
} }
//---------------------------------------------------------------------------------------------------------------------
QVector<QPointF> RoundPoints(QVector<QPointF> points)
{
for (int i=0; i < points.size(); ++i)
{
points[i] = QPointF(qRound(points.at(i).x()), qRound(points.at(i).y()));
}
return points;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QVector<VSAPoint> PrepareAllowance(const QVector<QPointF> &points) QVector<VSAPoint> PrepareAllowance(const QVector<QPointF> &points)
{ {
@ -436,7 +426,7 @@ QVector<QPointF> VLayoutPiece::GetContourPoints() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VLayoutPiece::SetCountourPoints(const QVector<QPointF> &points, bool hideMainPath) void VLayoutPiece::SetCountourPoints(const QVector<QPointF> &points, bool hideMainPath)
{ {
d->contour = RemoveDublicates(RoundPoints(points), false); d->contour = RemoveDublicates(points, false);
SetHideMainPath(hideMainPath); SetHideMainPath(hideMainPath);
} }
@ -457,7 +447,7 @@ void VLayoutPiece::SetSeamAllowancePoints(const QVector<QPointF> &points, bool s
d->seamAllowance = points; d->seamAllowance = points;
if (not d->seamAllowance.isEmpty()) if (not d->seamAllowance.isEmpty())
{ {
d->seamAllowance = RemoveDublicates(RoundPoints(d->seamAllowance), false); d->seamAllowance = RemoveDublicates(d->seamAllowance, false);
} }
else if (not IsSeamAllowanceBuiltIn()) else if (not IsSeamAllowanceBuiltIn())
{ {
@ -523,7 +513,7 @@ void VLayoutPiece::SetPieceText(const QString& qsName, const VPieceLabelData& da
} }
QScopedPointer<QGraphicsItem> item(GetMainPathItem()); QScopedPointer<QGraphicsItem> item(GetMainPathItem());
d->detailLabel = CorrectPosition(item->boundingRect(), RoundPoints(v)); d->detailLabel = CorrectPosition(item->boundingRect(), v);
// generate text // generate text
d->m_tmDetail.SetFont(font); d->m_tmDetail.SetFont(font);
@ -582,7 +572,7 @@ void VLayoutPiece::SetPatternInfo(const VAbstractPattern* pDoc, const VPatternLa
v[i] = RotatePoint(ptCenter, v.at(i), dAng); v[i] = RotatePoint(ptCenter, v.at(i), dAng);
} }
QScopedPointer<QGraphicsItem> item(GetMainPathItem()); QScopedPointer<QGraphicsItem> item(GetMainPathItem());
d->patternInfo = CorrectPosition(item->boundingRect(), RoundPoints(v)); d->patternInfo = CorrectPosition(item->boundingRect(), v);
// Generate text // Generate text
d->m_tmPattern.SetFont(font); d->m_tmPattern.SetFont(font);
@ -635,7 +625,7 @@ void VLayoutPiece::SetGrainline(const VGrainlineData& geom, const VContainer* pa
} }
QScopedPointer<QGraphicsItem> item(GetMainPathItem()); QScopedPointer<QGraphicsItem> item(GetMainPathItem());
d->grainlinePoints = CorrectPosition(item->boundingRect(), RoundPoints(v)); d->grainlinePoints = CorrectPosition(item->boundingRect(), v);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------