From 77be615877adf10edbca1be82e5a3a61c2bd7a4f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 21 Mar 2020 17:28:08 +0200 Subject: [PATCH] Improve empty sheet edge. User expects to have piece positioned tight to the top left corner of a paper sheet. --- src/libs/vlayout/vcontour.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp index 7a565e105..76fb6adce 100644 --- a/src/libs/vlayout/vcontour.cpp +++ b/src/libs/vlayout/vcontour.cpp @@ -278,8 +278,10 @@ QLineF VContour::GlobalEdge(int i) const 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); + edge = IsPortrait() ? QLineF(nShift*(i-1) + emptyEdge.x1(), emptyEdge.y1(), + nShift*i + emptyEdge.x1(), emptyEdge.y2()) : + QLineF(emptyEdge.x1(), nShift*(i-1) + emptyEdge.y1(), + emptyEdge.x2(), nShift*i + emptyEdge.y1()); } else { @@ -445,7 +447,7 @@ bool VContour::IsPortrait() const QLineF VContour::EmptySheetEdge() const { const int offset = qRound(accuracyPointOnLine*4.); - const int layoutOffset = qCeil(d->layoutWidth - accuracyPointOnLine*4.); + const int layoutOffset = qCeil(d->layoutWidth - accuracyPointOnLine*2.); return IsPortrait() ? QLineF(offset, -layoutOffset, d->paperWidth-offset, -layoutOffset) : QLineF(-layoutOffset, offset, -layoutOffset, d->paperHeight-offset); }