From 1ee4ccc8e51bdbfbbe509fdd75490fba84dcf1d0 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 15 May 2015 18:15:14 +0300 Subject: [PATCH] Fixed issue #302. Error when creating layout. --HG-- branch : develop --- src/libs/vlayout/vcontour.cpp | 11 ++++++++--- src/libs/vlayout/vcontour.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp index a9499fc2e..c2069e723 100644 --- a/src/libs/vlayout/vcontour.cpp +++ b/src/libs/vlayout/vcontour.cpp @@ -213,8 +213,7 @@ int VContour::EdgesCount() const return 1; } - const QLineF axis = QLineF(0, 0, d->paperWidth, 0); - const int n = qFloor(axis.length()/d->shift); + const int n = qFloor(EmptySheetEdge().length()/d->shift); if (n <= 0) { return 1; @@ -236,7 +235,7 @@ QLineF VContour::GlobalEdge(int i) const if (d->globalContour.isEmpty()) { // Because sheet is blank we have one global edge for all cases - Ox axis. - const QLineF axis = QLineF(0, 0, d->paperWidth - 5, 0); + const QLineF axis = EmptySheetEdge(); if (d->shift == 0) { return axis; @@ -328,3 +327,9 @@ void VContour::AppendWhole(QVector &contour, const VLayoutDetail &detai ++j; }while (processedEdges < nD); } + +//--------------------------------------------------------------------------------------------------------------------- +QLineF VContour::EmptySheetEdge() const +{ + return QLineF(0, 0, d->paperWidth - 5, 0); +} diff --git a/src/libs/vlayout/vcontour.h b/src/libs/vlayout/vcontour.h index 56c3bac9a..dfd6442ae 100644 --- a/src/libs/vlayout/vcontour.h +++ b/src/libs/vlayout/vcontour.h @@ -65,6 +65,7 @@ public: QVector UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ, BestFrom type) const; + QLineF EmptySheetEdge() const; int EdgesCount() const; QLineF GlobalEdge(int i) const; QVector CutEdge(const QLineF &edge) const;