diff --git a/katana/src/NegociateWindow.cpp b/katana/src/NegociateWindow.cpp index 955bf8ee..7cebd503 100644 --- a/katana/src/NegociateWindow.cpp +++ b/katana/src/NegociateWindow.cpp @@ -316,6 +316,10 @@ namespace Katana { Track* track = plane->getTrackByPosition ( autoSegment->getAxis() ); Interval uside = autoSegment->getAutoSource()->getGCell()->getSide( perpandicularTo(autoSegment->getDirection()) ); + Interval constraints; + autoSegment->getConstraints( constraints ); + uside.intersection( constraints ); + cdebug_log(159,0) << "* Nearest " << track << endl; if (track->getAxis() > uside.getVMax()) track = track->getPreviousTrack(); diff --git a/kite/src/NegociateWindow.cpp b/kite/src/NegociateWindow.cpp index 7cbb3f8e..038f23aa 100644 --- a/kite/src/NegociateWindow.cpp +++ b/kite/src/NegociateWindow.cpp @@ -283,6 +283,10 @@ namespace Kite { Track* track = plane->getTrackByPosition ( autoSegment->getAxis() ); Interval uside = autoSegment->getAutoSource()->getGCell()->getSide( perpandicularTo(autoSegment->getDirection()) ); + Interval constraints; + autoSegment->getConstraints( constraints ); + uside.intersection( constraints ); + if (track->getAxis() > uside.getVMax()) track = track->getPreviousTrack(); if (track->getAxis() < uside.getVMin()) track = track->getNextTrack();