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; }