From cc2aa8d1ba77caf6a4b7e4f4092fc2de3e098835 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 21 Jul 2019 10:23:17 +0300 Subject: [PATCH] - Fix edge position for empty sheet. Make it close to paper sheet. - Fix getting contour edge. It must be based on position from empty sheet edge for "empty" contour. --HG-- branch : develop --- src/libs/vlayout/vcontour.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp index 989f442ad..790635038 100644 --- a/src/libs/vlayout/vcontour.cpp +++ b/src/libs/vlayout/vcontour.cpp @@ -221,8 +221,10 @@ QLineF VContour::GlobalEdge(int i) const return EmptySheetEdge(); } - const qreal nShift = EmptySheetEdge().length()/GlobalEdgesCount(); - edge = IsPortrait() ? QLineF(nShift*(i-1), 0, nShift*i, 0) : QLineF(0, nShift*(i-1), 0, nShift*i); + const QLineF emptyEdge = EmptySheetEdge(); + const qreal nShift = emptyEdge.length()/GlobalEdgesCount(); + edge = IsPortrait() ? QLineF(nShift*(i-1), emptyEdge.y1(), nShift*i, emptyEdge.y2()) : + QLineF(emptyEdge.x1(), nShift*(i-1), emptyEdge.x2(), nShift*i); } else { @@ -379,8 +381,8 @@ bool VContour::IsPortrait() const //--------------------------------------------------------------------------------------------------------------------- QLineF VContour::EmptySheetEdge() const { - static const int offset = 2; - const int layoutOffset = qCeil(d->layoutWidth + accuracyPointOnLine); + const int offset = qRound(accuracyPointOnLine*4.); + const int layoutOffset = qCeil(d->layoutWidth - accuracyPointOnLine*4.); return IsPortrait() ? QLineF(offset, -layoutOffset, d->paperWidth-offset, -layoutOffset) : QLineF(-layoutOffset, offset, -layoutOffset, d->paperHeight-offset); }