- 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
This commit is contained in:
Roman Telezhynskyi 2019-07-21 10:23:17 +03:00
parent e18d328178
commit cc2aa8d1ba

View File

@ -221,8 +221,10 @@ QLineF VContour::GlobalEdge(int i) const
return EmptySheetEdge(); return EmptySheetEdge();
} }
const qreal nShift = EmptySheetEdge().length()/GlobalEdgesCount(); const QLineF emptyEdge = EmptySheetEdge();
edge = IsPortrait() ? QLineF(nShift*(i-1), 0, nShift*i, 0) : QLineF(0, nShift*(i-1), 0, nShift*i); 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 else
{ {
@ -379,8 +381,8 @@ bool VContour::IsPortrait() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QLineF VContour::EmptySheetEdge() const QLineF VContour::EmptySheetEdge() const
{ {
static const int offset = 2; const int offset = qRound(accuracyPointOnLine*4.);
const int layoutOffset = qCeil(d->layoutWidth + accuracyPointOnLine); const int layoutOffset = qCeil(d->layoutWidth - accuracyPointOnLine*4.);
return IsPortrait() ? QLineF(offset, -layoutOffset, d->paperWidth-offset, -layoutOffset) : return IsPortrait() ? QLineF(offset, -layoutOffset, d->paperWidth-offset, -layoutOffset) :
QLineF(-layoutOffset, offset, -layoutOffset, d->paperHeight-offset); QLineF(-layoutOffset, offset, -layoutOffset, d->paperHeight-offset);
} }