Schematic: don't trim unchanged segments that are connected

Previously if you had a wire with two unconnected ends and dragged the
end of another wire to connect with one end, it would delete the first
wire.
This commit is contained in:
Mike Williams 2022-12-13 09:01:52 -05:00
parent bbdb30135e
commit 5e72a1008b
2 changed files with 5 additions and 1 deletions

View File

@ -309,6 +309,9 @@ bool SCH_EDIT_FRAME::BreakSegment( SCH_LINE* aSegment, const VECTOR2I& aPoint,
SaveCopyInUndoList( aScreen, newSegment, UNDO_REDO::NEWITEM, true );
SaveCopyInUndoList( aScreen, aSegment, UNDO_REDO::CHANGED, true );
aSegment->SetFlags( IS_CHANGED );
newSegment->SetFlags( IS_NEW );
UpdateItem( aSegment, false, true );
aSegment->SetEndPoint( aPoint );

View File

@ -934,7 +934,8 @@ void SCH_MOVE_TOOL::trimDanglingLines()
// Find split segments (one segment is new, the other is changed) that
// we aren't dragging and don't have selected
if( aChangedItem->IsDangling() && !aChangedItem->IsSelected()
&& ( aChangedItem->IsNew() || !aChangedItem->IsDragging() )
&& ( aChangedItem->IsNew()
|| ( !aChangedItem->IsDragging() && aChangedItem->IsModified() ) )
&& aChangedItem->IsType( { SCH_LINE_T } ) )
{
danglers.insert( aChangedItem );