From 5b469e458f8c603300b14ea13925e906534cc39d Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Thu, 26 May 2022 17:51:25 +0200 Subject: [PATCH] Bug in AutoSegment::getEndAxis() computation. * Bug: In AutoSegment::getEndAxes(), as the NonAligned flag may be wrong, always loop over the aligneds (if any). Then, the target axis computation was wrong, using a min() instead of a max(). This was, in turn, wrongly activating isNearMinArea() and causing non-minimal length segment to have their extremeties extented. And, in the end, Track overlap. --- anabatic/src/AutoSegment.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/anabatic/src/AutoSegment.cpp b/anabatic/src/AutoSegment.cpp index f31b1ead..0cbc66e5 100644 --- a/anabatic/src/AutoSegment.cpp +++ b/anabatic/src/AutoSegment.cpp @@ -906,12 +906,12 @@ namespace Anabatic { sourceAxis = getSourceU(); targetAxis = getTargetU(); - if (not isNotAligned()) { + //if (not isNotAligned()) { for( AutoSegment* aligned : const_cast(this)->getAligneds() ) { sourceAxis = std::min( sourceAxis, aligned->getSourceU() ); - targetAxis = std::min( targetAxis, aligned->getTargetU() ); + targetAxis = std::max( targetAxis, aligned->getTargetU() ); } - } + //} }