diff --git a/libs/kimath/src/geometry/shape_line_chain.cpp b/libs/kimath/src/geometry/shape_line_chain.cpp index bbec0b869c..0de1f7cc9a 100644 --- a/libs/kimath/src/geometry/shape_line_chain.cpp +++ b/libs/kimath/src/geometry/shape_line_chain.cpp @@ -308,11 +308,14 @@ void SHAPE_LINE_CHAIN::Replace( int aStartIndex, int aEndIndex, const SHAPE_LINE Remove( aStartIndex, aEndIndex ); // The total new arcs index is added to the new arc indices - size_t prev_arc_count = m_arcs.size(); - auto new_shapes = aLine.m_shapes; + size_t prev_arc_count = m_arcs.size(); + std::vector new_shapes = aLine.m_shapes; - for( auto& shape : new_shapes ) - shape += prev_arc_count; + for( long& shape : new_shapes ) + { + if( shape >= 0 ) + shape += prev_arc_count; + } m_shapes.insert( m_shapes.begin() + aStartIndex, new_shapes.begin(), new_shapes.end() ); m_points.insert( m_points.begin() + aStartIndex, aLine.m_points.begin(), aLine.m_points.end() ); diff --git a/pcbnew/router/pns_dragger.cpp b/pcbnew/router/pns_dragger.cpp index ebf83a35ef..d9b05375a6 100644 --- a/pcbnew/router/pns_dragger.cpp +++ b/pcbnew/router/pns_dragger.cpp @@ -506,7 +506,8 @@ bool DRAGGER::dragWalkaround( const VECTOR2I& aP ) if( ok ) { - //Dbg()->AddLine( origLine.CLine(), 4, 100000 ); + Dbg()->AddLine( origLine.CLine(), 5, 50000 ); + Dbg()->AddLine( draggedWalk.CLine(), 6, 75000 ); m_lastNode->Remove( origLine ); optimizeAndUpdateDraggedLine( draggedWalk, origLine, aP ); } @@ -550,7 +551,7 @@ bool DRAGGER::dragShove( const VECTOR2I& aP ) else dragged.DragCorner( aP, m_draggedSegmentIndex ); - Dbg()->AddLine( dragged.CLine(), 5, 10000 ); + Dbg()->AddLine( dragged.CLine(), 5, 5000 ); SHOVE::SHOVE_STATUS st = m_shove->ShoveLines( dragged ); diff --git a/pcbnew/router/pns_line.h b/pcbnew/router/pns_line.h index 7d57b459fd..7003e03792 100644 --- a/pcbnew/router/pns_line.h +++ b/pcbnew/router/pns_line.h @@ -119,7 +119,7 @@ public: bool IsLinkedChecked() const { - return IsLinked() && LinkCount() == SegmentCount(); + return IsLinked() && LinkCount() == ShapeCount(); } ///< Assign a shape to the line (a polyline/line chain).