From 55509e523d6edee0e8128ec52a28cef58e2de56b Mon Sep 17 00:00:00 2001 From: fabrice salvaire Date: Mon, 23 Jan 2017 17:20:15 +0100 Subject: [PATCH] fixed typo in code: allowence and greed --HG-- branch : develop --- src/libs/vlayout/vlayoutdetail.cpp | 4 +- src/libs/vlayout/vlayoutdetail_p.h | 6 +-- src/libs/vlayout/vposter.cpp | 46 +++++++++---------- src/libs/vlayout/vposter.h | 4 +- src/libs/vpatterndb/vdetail.cpp | 2 +- .../vtools/dialogs/tools/dialogdetail.cpp | 2 +- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index 08e6ea135..cb00675b7 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -117,7 +117,7 @@ void VLayoutDetail::SetSeamAllowencePoints(const QVector &points, bool } else { - qWarning()<<"Seam allowence is empty."; + qWarning()<<"Seam allowance is empty."; setSeamAllowance(false); } } @@ -511,7 +511,7 @@ QPainterPath VLayoutDetail::ContourPath() const } path.lineTo(points.at(0)); - // seam allowence + // seam allowance if (getSeamAllowance() == true) { points = GetSeamAllowencePoints(); diff --git a/src/libs/vlayout/vlayoutdetail_p.h b/src/libs/vlayout/vlayoutdetail_p.h index 289af3275..cd4478fb7 100644 --- a/src/libs/vlayout/vlayoutdetail_p.h +++ b/src/libs/vlayout/vlayoutdetail_p.h @@ -67,16 +67,16 @@ public: /** @brief contour list of contour points. */ QVector contour; - /** @brief seamAllowence list of seam allowence points. */ + /** @brief seamAllowence list of seam allowance points. */ QVector seamAllowence; - /** @brief layoutAllowence list of layout allowence points. */ + /** @brief layoutAllowence list of layout allowance points. */ QVector layoutAllowence; /** @brief matrix transformation matrix*/ QTransform matrix; - /** @brief layoutWidth value layout allowence width in pixels. */ + /** @brief layoutWidth value layout allowance width in pixels. */ qreal layoutWidth; bool mirror; diff --git a/src/libs/vlayout/vposter.cpp b/src/libs/vlayout/vposter.cpp index 5f52cb1b5..fbad63ee1 100644 --- a/src/libs/vlayout/vposter.cpp +++ b/src/libs/vlayout/vposter.cpp @@ -44,7 +44,7 @@ //--------------------------------------------------------------------------------------------------------------------- VPoster::VPoster(const QPrinter *printer) - :printer(printer), allowence(static_cast(qRound(10./25.4*PrintDPI)))//1 cm + :printer(printer), allowance(static_cast(qRound(10./25.4*PrintDPI)))//1 cm { } @@ -92,7 +92,7 @@ QVector VPoster::Borders(QGraphicsItem *parent, const PosterDat data.append(line); auto *scissors = new QGraphicsPixmapItem(QPixmap("://scissors_vertical.png"), parent); - scissors->setPos(rec.x(), rec.y() + rec.height()-static_cast(allowence)); + scissors->setPos(rec.x(), rec.y() + rec.height()-static_cast(allowance)); data.append(scissors); } @@ -100,8 +100,8 @@ QVector VPoster::Borders(QGraphicsItem *parent, const PosterDat {// Right border auto *line = new QGraphicsLineItem(parent); line->setPen(pen); - line->setLine(rec.x() + rec.width()-static_cast(allowence), rec.y(), - rec.x() + rec.width()-static_cast(allowence), rec.y() + rec.height()); + line->setLine(rec.x() + rec.width()-static_cast(allowance), rec.y(), + rec.x() + rec.width()-static_cast(allowance), rec.y() + rec.height()); data.append(line); } @@ -113,7 +113,7 @@ QVector VPoster::Borders(QGraphicsItem *parent, const PosterDat data.append(line); auto *scissors = new QGraphicsPixmapItem(QPixmap("://scissors_horizontal.png"), parent); - scissors->setPos(rec.x() + rec.width()-static_cast(allowence), rec.y()); + scissors->setPos(rec.x() + rec.width()-static_cast(allowance), rec.y()); data.append(scissors); } @@ -122,15 +122,15 @@ QVector VPoster::Borders(QGraphicsItem *parent, const PosterDat // Bottom border (mandatory) auto *line = new QGraphicsLineItem(parent); line->setPen(pen); - line->setLine(rec.x(), rec.y() + rec.height()-static_cast(allowence), - rec.x() + rec.width(), rec.y() + rec.height()-static_cast(allowence)); + line->setLine(rec.x(), rec.y() + rec.height()-static_cast(allowance), + rec.x() + rec.width(), rec.y() + rec.height()-static_cast(allowance)); data.append(line); if (img.row == img.rows-1) { auto *scissors = new QGraphicsPixmapItem(QPixmap("://scissors_horizontal.png"), parent); - scissors->setPos(rec.x() + rec.width()-static_cast(allowence), - rec.y() + rec.height()-static_cast(allowence)); + scissors->setPos(rec.x() + rec.width()-static_cast(allowance), + rec.y() + rec.height()-static_cast(allowance)); data.append(scissors); } } @@ -140,8 +140,8 @@ QVector VPoster::Borders(QGraphicsItem *parent, const PosterDat const int layoutX = 15; const int layoutY = 5; - labels->setPos(rec.x() + layoutX, rec.y() + rec.height()-static_cast(allowence)+layoutY); - labels->setTextWidth(rec.width()-(static_cast(allowence)+layoutX)); + labels->setPos(rec.x() + layoutX, rec.y() + rec.height()-static_cast(allowance)+layoutY); + labels->setTextWidth(rec.width()-(static_cast(allowance)+layoutX)); const QString grid = tr("Grid ( %1 , %2 )").arg(img.row+1).arg(img.column+1); const QString page = tr("Page %1 of %2").arg(img.row*(img.columns)+img.column+1).arg(img.rows*img.columns); @@ -198,18 +198,18 @@ int VPoster::CountRows(int height) const // * // ― - const int pCount = qCeil(imgLength/pageLength);// Pages count without allowence (or allowence = 0) (3) + const int pCount = qCeil(imgLength/pageLength);// Pages count without allowance (or allowance = 0) (3) - // Calculate how many pages will be after using allowence. + // Calculate how many pages will be after using allowance. // We know start pages count. This number not enought because - // each n-1 pages add (n-1)*allowence length to page (1). - const qreal addionalLength = (pCount-1)*static_cast(allowence); //-V636 + // each n-1 pages add (n-1)*allowance length to page (1). + const qreal addionalLength = (pCount-1)*static_cast(allowance); //-V636 // Calculate additional length form pages that will cover this length (2). // In the end add page length (3). // Bottom page have mandatory border (4) return qCeil((addionalLength + - qCeil(addionalLength/pageLength)*static_cast(allowence) + static_cast(allowence) + + qCeil(addionalLength/pageLength)*static_cast(allowance) + static_cast(allowance) + imgLength)/pageLength); } @@ -228,16 +228,16 @@ int VPoster::CountColumns(int width) const // |----| // ^ // (2) - const int pCount = qCeil(imgLength/pageLength);// Pages count without allowence (or allowence = 0) (3) + const int pCount = qCeil(imgLength/pageLength);// Pages count without allowance (or allowance = 0) (3) - // Calculate how many pages will be after using allowence. + // Calculate how many pages will be after using allowance. // We know start pages count. This number not enought because - // each n-1 pages add (n-1)*allowence length to page (1). - const qreal addionalLength = (pCount-1)*static_cast(allowence); //-V636 + // each n-1 pages add (n-1)*allowance length to page (1). + const qreal addionalLength = (pCount-1)*static_cast(allowance); //-V636 // Calculate additional length form pages that will cover this length (2). // In the end add page length (3). - return qCeil((addionalLength + qCeil(addionalLength/pageLength)*static_cast(allowence) + + return qCeil((addionalLength + qCeil(addionalLength/pageLength)*static_cast(allowance) + imgLength)/pageLength); } @@ -246,8 +246,8 @@ PosterData VPoster::Cut(int i, int j, const QRect &imageRect) const { Q_UNUSED(imageRect) - const int x = j*PageRect().width() - j*static_cast(allowence); - const int y = i*PageRect().height() - i*static_cast(allowence); + const int x = j*PageRect().width() - j*static_cast(allowance); + const int y = i*PageRect().height() - i*static_cast(allowance); SCASSERT(x <= imageRect.width()) SCASSERT(y <= imageRect.height()) diff --git a/src/libs/vlayout/vposter.h b/src/libs/vlayout/vposter.h index 58047a176..6a4da32e5 100644 --- a/src/libs/vlayout/vposter.h +++ b/src/libs/vlayout/vposter.h @@ -48,7 +48,7 @@ struct PosterData rect(){} quint32 index; // paper index - quint32 row; // positions in the greed + quint32 row; // positions in the grid quint32 column; quint32 rows; quint32 columns; @@ -66,7 +66,7 @@ public: QVector Borders(QGraphicsItem *parent, const PosterData &img, int sheets) const; private: const QPrinter *printer; - quint32 allowence; + quint32 allowance; int CountRows(int height) const; int CountColumns(int width) const; diff --git a/src/libs/vpatterndb/vdetail.cpp b/src/libs/vpatterndb/vdetail.cpp index 665f3fd9b..230b4f3a0 100644 --- a/src/libs/vpatterndb/vdetail.cpp +++ b/src/libs/vpatterndb/vdetail.cpp @@ -507,7 +507,7 @@ QPainterPath VDetail::SeamAllowancePath(const VContainer *data) const const QVector pointsEkv = SeamAllowancePoints(data); QPainterPath ekv; - // seam allowence + // seam allowance if (getSeamAllowance()) { if (not pointsEkv.isEmpty()) diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp index 2a6667ddb..75561d9a6 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.cpp +++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp @@ -100,7 +100,7 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge { ui.doubleSpinBoxSeams->setDecimals(5); } - // Default value for seam allowence is 1 cm. But pattern have different units, so just set 1 in dialog not enough. + // Default value for seam allowance is 1 cm. But pattern have different units, so just set 1 in dialog not enough. ui.doubleSpinBoxSeams->setValue(UnitConvertor(1, Unit::Cm, qApp->patternUnit())); bOk = ui.buttonBox->button(QDialogButtonBox::Ok);