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.
This commit is contained in:
Jean-Paul Chaput 2022-05-26 17:51:25 +02:00
parent 2efae3507e
commit 5b469e458f
1 changed files with 3 additions and 3 deletions

View File

@ -906,12 +906,12 @@ namespace Anabatic {
sourceAxis = getSourceU(); sourceAxis = getSourceU();
targetAxis = getTargetU(); targetAxis = getTargetU();
if (not isNotAligned()) { //if (not isNotAligned()) {
for( AutoSegment* aligned : const_cast<AutoSegment*>(this)->getAligneds() ) { for( AutoSegment* aligned : const_cast<AutoSegment*>(this)->getAligneds() ) {
sourceAxis = std::min( sourceAxis, aligned->getSourceU() ); sourceAxis = std::min( sourceAxis, aligned->getSourceU() );
targetAxis = std::min( targetAxis, aligned->getTargetU() ); targetAxis = std::max( targetAxis, aligned->getTargetU() );
}
} }
//}
} }