From f4f6ba9989ea9c9476acd38cad578d8f32ae5776 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 26 Nov 2020 19:11:42 +0200 Subject: [PATCH] Improve canceling nesting. --- ChangeLog.txt | 1 + src/libs/vlayout/vposition.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 2a4a53921..5a3d9b9e5 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,6 @@ # Version 0.7.41 (unreleased) - Bug fixes. +- Improve canceling nesting. # Version 0.7.40 Nov 23, 2020 - New function Warning. diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index 9947d3451..542b8c14e 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -446,6 +446,11 @@ void VPosition::RotateOnAngle(qreal angle) if (CheckRotationEdges(workDetail, m_data.j, m_data.i, angle)) { + if (stop->load()) + { + return; + } + #ifdef LAYOUT_DEBUG # ifdef SHOW_CANDIDATE_BEST DumpFrame(m_data.gContour, workDetail, m_data.mutex, m_data.details); @@ -592,6 +597,11 @@ void VPosition::FollowGrainline() //--------------------------------------------------------------------------------------------------------------------- void VPosition::FindBestPosition() { + if (stop->load()) + { + return; + } + if (not m_data.followGrainline || not m_data.detail.IsGrainlineEnabled()) { // We should use copy of the detail. @@ -600,6 +610,11 @@ void VPosition::FindBestPosition() int dEdge = m_data.i;// For mirror detail edge will be different if (CheckCombineEdges(workDetail, m_data.j, dEdge)) { + if (stop->load()) + { + return; + } + #ifdef LAYOUT_DEBUG # ifdef SHOW_CANDIDATE_BEST DumpFrame(m_data.gContour, workDetail, m_data.mutex, m_data.details);