From 3ce704d039d6ddca4386367600ecb703601f49f9 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 26 Nov 2020 19:55:02 +0200 Subject: [PATCH] Improve crossing check for the layout algorithm. --- ChangeLog.txt | 1 + src/libs/vlayout/vposition.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index d4d8088c0..efb8159f3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,6 +2,7 @@ - Bug fixes. - Improve canceling nesting. - Fix incorrect nesting status for valid cases. +- Improve crossing check for the layout algorithm. # 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 542b8c14e..4570d8ab0 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -480,10 +480,11 @@ VPosition::CrossingType VPosition::Crossing(const VLayoutPiece &detail) const for(auto &position : m_data.positionsCache) { - if (position.boundingRect.intersects(layoutBoundingRect) || position.boundingRect.contains(detailBoundingRect)) + if (position.boundingRect.intersects(layoutBoundingRect) || position.boundingRect.contains(detailBoundingRect) + || detailBoundingRect.contains(position.boundingRect)) { - if (position.layoutAllowancePath.contains(contourPath) || - position.layoutAllowancePath.intersects(layoutAllowancePath)) + if (position.layoutAllowancePath.contains(contourPath) || contourPath.contains(position.layoutAllowancePath) + || position.layoutAllowancePath.intersects(layoutAllowancePath)) { return CrossingType::Intersection; }