From 78d878322d45dc91e6bb7ddb87e88dcd18dfd5a0 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 13 Mar 2024 16:26:10 +0200 Subject: [PATCH] Fix incorrect piece geometry refresh if disable a mirror line. Fold line still visible. --- src/libs/vlayout/vfoldline.cpp | 6 ++++++ src/libs/vtools/tools/vtoolseamallowance.cpp | 10 ++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libs/vlayout/vfoldline.cpp b/src/libs/vlayout/vfoldline.cpp index 63f9b11f8..ca44a068e 100644 --- a/src/libs/vlayout/vfoldline.cpp +++ b/src/libs/vlayout/vfoldline.cpp @@ -290,6 +290,12 @@ void VFoldLine::UpdateFoldLineLabel(QGraphicsSimpleTextItem *item) const return; } + if (m_foldLine.isNull()) + { + item->setVisible(false); + return; + } + if (m_type == FoldLineType::TwoArrows || m_type == FoldLineType::ThreeDots || m_type == FoldLineType::ThreeX || m_type == FoldLineType::None) { diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index edc5432fa..78e9cb47e 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -2740,10 +2740,7 @@ void VToolSeamAllowance::UpdateFoldLine(const VFoldLine &foldLine) if (detail.GetFoldLineType() == FoldLineType::ThreeDots || detail.GetFoldLineType() == FoldLineType::ThreeX || detail.GetFoldLineType() == FoldLineType::TwoArrows) { - if (!shape.isEmpty()) - { - m_foldLineMark->setPath(shape.constFirst()); - } + m_foldLineMark->setPath(!shape.isEmpty() ? shape.constFirst() : QPainterPath()); m_foldLineLabel->setPath(QPainterPath()); } else if (detail.GetFoldLineType() == FoldLineType::Text) @@ -2765,10 +2762,7 @@ void VToolSeamAllowance::UpdateFoldLine(const VFoldLine &foldLine) } else { - if (!shape.isEmpty()) - { - m_foldLineMark->setPath(shape.constFirst()); - } + m_foldLineMark->setPath(!shape.isEmpty() ? shape.constFirst() : QPainterPath()); if (shape.size() > 1 && (settings->GetSingleStrokeOutlineFont() || settings->GetSingleLineFonts())) {