diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index 83744240b..7994264af 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -415,7 +415,7 @@ void VLayoutGenerator::UnitePages() int paperHeight = 0; if (autoCrop) { - paperHeight = qRound(papers.at(i).DetailsBoundingRect().height()); + paperHeight = qCeil(papers.at(i).DetailsBoundingRect().height()); } else { @@ -447,7 +447,7 @@ void VLayoutGenerator::UnitePages() int paperWidth = 0; if (autoCrop) { - paperWidth = qRound(papers.at(i).DetailsBoundingRect().width()); + paperWidth = qCeil(papers.at(i).DetailsBoundingRect().width()); } else { @@ -479,8 +479,8 @@ void VLayoutGenerator::UnitePages() QVector nPapers; for (int i = 0; i < nDetails.size(); ++i) { - const int height = IsPortrait() ? qFloor(papersLength.at(i)) : PageHeight(); - const int width = IsPortrait() ? PageWidth() : qFloor(papersLength.at(i)); + const int height = IsPortrait() ? qCeil(papersLength.at(i)) : PageHeight(); + const int width = IsPortrait() ? PageWidth() : qCeil(papersLength.at(i)); VLayoutPaper paper(height, width, bank->GetLayoutWidth()); paper.SetShift(shift); diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 64792ca56..ced887ebd 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -345,29 +345,16 @@ QGraphicsRectItem *VLayoutPaper::GetPaperItem(bool autoCrop, bool textAsPaths) c scene->addItem(item); } + const QRect boundingRect = scene->itemsBoundingRect().toRect(); if (d->globalContour.IsPortrait()) { - const int height = scene->itemsBoundingRect().toRect().height(); - if (d->globalContour.GetHeight() > height) //-V807 - { - paper = new QGraphicsRectItem(QRectF(0, 0, d->globalContour.GetWidth(), height)); - } - else - { - paper = new QGraphicsRectItem(QRectF(0, 0, d->globalContour.GetWidth(), d->globalContour.GetHeight())); - } + const int height = boundingRect.height() + boundingRect.y() + 1; + paper = new QGraphicsRectItem(QRectF(0, 0, d->globalContour.GetWidth(), height)); } else { - const int width = scene->itemsBoundingRect().toRect().width(); - if (d->globalContour.GetWidth() > width) //-V807 - { - paper = new QGraphicsRectItem(QRectF(0, 0, width, d->globalContour.GetHeight())); - } - else - { - paper = new QGraphicsRectItem(QRectF(0, 0, d->globalContour.GetWidth(), d->globalContour.GetHeight())); - } + const int width = boundingRect.width() + boundingRect.x() + 1; + paper = new QGraphicsRectItem(QRectF(0, 0, width, d->globalContour.GetHeight())); } } else