Hide fold line when piece in full show and user doesn't want to see a mirror line.

This commit is contained in:
Roman Telezhynskyi 2024-06-25 13:08:04 +03:00
parent 4a4cd0b576
commit b701e0f03b
5 changed files with 32 additions and 8 deletions

View file

@ -953,8 +953,13 @@ void VPGraphicsPiece::PaintMirrorLine(QPainter *painter, const VPPiecePtr &piece
//---------------------------------------------------------------------------------------------------------------------
void VPGraphicsPiece::PaintFoldLine(QPainter *painter, const VPPiecePtr &piece)
{
if (piece->GetFoldLineType() == FoldLineType::None)
if (piece->GetFoldLineType() == FoldLineType::None || (piece->IsShowFullPiece() && !piece->IsShowMirrorLine()))
{
if (m_foldLineLabelText != nullptr)
{
m_foldLineLabelText->setVisible(false);
}
return;
}

View file

@ -1266,6 +1266,11 @@ void VDxfEngine::ExportAAMADrill(const QSharedPointer<dx_ifaceBlock> &detailBloc
//---------------------------------------------------------------------------------------------------------------------
void VDxfEngine::ExportAAMADrawFoldLine(const QSharedPointer<dx_ifaceBlock> &detailBlock, const VLayoutPiece &detail)
{
if (detail.IsShowFullPiece() && !detail.IsShowMirrorLine())
{
return;
}
VFoldLine const fLine = detail.FoldLine();
QVector<QVector<QPointF>> points = fLine.FoldLineMarkPoints();
if (points.isEmpty())
@ -1728,6 +1733,11 @@ void VDxfEngine::ExportASTMMirrorLine(const QSharedPointer<dx_ifaceBlock> &detai
//---------------------------------------------------------------------------------------------------------------------
void VDxfEngine::ExportASTMDrawFoldLine(const QSharedPointer<dx_ifaceBlock> &detailBlock, const VLayoutPiece &detail)
{
if (detail.IsShowFullPiece() && !detail.IsShowMirrorLine())
{
return;
}
VFoldLine const fLine = detail.FoldLine();
QVector<QVector<QPointF>> points = fLine.FoldLineMarkPoints();
if (points.isEmpty())

View file

@ -577,6 +577,11 @@ void VHPGLEngine::PlotMirrorLine(QTextStream &out, const VLayoutPiece &detail)
//---------------------------------------------------------------------------------------------------------------------
void VHPGLEngine::PlotFoldLine(QTextStream &out, const VLayoutPiece &detail)
{
if (detail.IsShowFullPiece() && !detail.IsShowMirrorLine())
{
return;
}
VFoldLine const fLine = detail.FoldLine();
switch (detail.GetFoldLineType())

View file

@ -2187,7 +2187,7 @@ void VLayoutPiece::CreateFoldLineItem(QGraphicsItem *parent, bool textAsPaths) c
{
SCASSERT(parent != nullptr)
if (GetFoldLineType() == FoldLineType::None)
if (GetFoldLineType() == FoldLineType::None || (IsShowFullPiece() && !IsShowMirrorLine()))
{
return;
}

View file

@ -2809,9 +2809,18 @@ auto VToolSeamAllowance::DuplicatePlaceLabels(const QVector<quint32> &placeLabel
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::UpdateFoldLine(const VFoldLine &foldLine)
{
VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings();
const VPiece detail = VAbstractTool::data.GetPiece(m_id);
if (detail.GetFoldLineType() == FoldLineType::None || (detail.IsShowFullPiece() && !detail.IsShowMirrorLine()))
{
m_foldLineLabelText->setVisible(false);
m_foldLineMark->setPath(QPainterPath());
m_foldLineLabel->setPath(QPainterPath());
return;
}
VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings();
if (settings->GetSingleStrokeOutlineFont() || settings->GetSingleLineFonts())
{
m_foldLineLabelText->setVisible(false);
@ -2841,11 +2850,6 @@ void VToolSeamAllowance::UpdateFoldLine(const VFoldLine &foldLine)
m_foldLineLabel->setPath(QPainterPath());
}
}
else if (detail.GetFoldLineType() == FoldLineType::None)
{
m_foldLineMark->setPath(QPainterPath());
m_foldLineLabel->setPath(QPainterPath());
}
else
{
m_foldLineMark->setPath(!shape.isEmpty() ? shape.constFirst() : QPainterPath());