From 363fc598c0a412240133b8841635be6d3cfb0988 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 23 Sep 2017 15:20:20 +1000 Subject: [PATCH] Fixed bug in FlipLayerMask - Offset for internal copper layers was incorrect - Incorrect mask was used --- common/lset.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/common/lset.cpp b/common/lset.cpp index 5244fee606..841457b20e 100644 --- a/common/lset.cpp +++ b/common/lset.cpp @@ -554,20 +554,25 @@ LSET FlipLayerMask( LSET aMask, int aCopperLayersCount ) if( aCopperLayersCount >= 4 ) // Internal layers exist { - LSET internalMask = aMask & ~LSET::InternalCuMask(); + LSET internalMask = aMask & LSET::InternalCuMask(); if( internalMask != LSET::InternalCuMask() ) - { // the mask does not include all internal layers. Therefore + { + // the mask does not include all internal layers. Therefore // the flipped mask for internal copper layers must be built + int innerLayerCnt = aCopperLayersCount -2; for( int ii = 0; ii < innerLayerCnt; ii++ ) { - //TODO there is a problem with this code - if( internalMask[innerLayerCnt - ii + In1_Cu] ) + if( internalMask[innerLayerCnt - ii] ) + { newMask.set( ii + In1_Cu ); + } else + { newMask.reset( ii + In1_Cu ); + } } } }