Fix way we calculate shift for empty sheet. Make it adjustable only if less

than default.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-07-18 17:40:41 +03:00
parent f99acfb8c9
commit 8888437b07

View File

@ -359,8 +359,15 @@ void VContour::ResetAttributes()
//---------------------------------------------------------------------------------------------------------------------
int VContour::EmptySheetEdgesCount() const
{
const qreal shift = qFuzzyIsNull(d->shift) ? ToPixel(0.5, Unit::Cm) : d->shift;
return qFloor(EmptySheetEdge().length()/shift);
qreal defaultShift = ToPixel(0.5, Unit::Cm);
const qreal emptyEdgeLength = EmptySheetEdge().length();
if (emptyEdgeLength < defaultShift)
{
defaultShift = emptyEdgeLength / 2.0;
}
const qreal shift = (qFuzzyIsNull(d->shift) || d->shift > defaultShift) ? defaultShift : d->shift;
return qFloor(emptyEdgeLength/shift);
}
//---------------------------------------------------------------------------------------------------------------------