diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp index d8e1eae35a..e3a6c77c3d 100644 --- a/eeschema/bus-wire-junction.cpp +++ b/eeschema/bus-wire-junction.cpp @@ -304,12 +304,13 @@ void SCH_EDIT_FRAME::BreakSegment( SCH_LINE* aSegment, const VECTOR2I& aPoint, newSegment->SetStartPoint( aPoint ); newSegment->SetConnectivityDirty( true ); + newSegment->SetFlags( IS_NEW | IS_BROKEN ); AddToScreen( newSegment, aScreen ); SaveCopyInUndoList( aScreen, newSegment, UNDO_REDO::NEWITEM, true ); SaveCopyInUndoList( aScreen, aSegment, UNDO_REDO::CHANGED, true ); - aSegment->SetFlags( IS_CHANGED ); + aSegment->SetFlags( IS_CHANGED | IS_BROKEN ); UpdateItem( aSegment, false, true ); aSegment->SetEndPoint( aPoint ); diff --git a/eeschema/tools/sch_move_tool.cpp b/eeschema/tools/sch_move_tool.cpp index e756b26db1..b156c33393 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -966,10 +966,7 @@ void SCH_MOVE_TOOL::trimDanglingLines() // Delete newly dangling lines: // 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->IsModified() ) ) - && aChangedItem->IsType( { SCH_LINE_T } ) ) + if( aChangedItem->HasFlag( IS_BROKEN) && aChangedItem->IsDangling() && !aChangedItem->IsSelected() ) { danglers.insert( aChangedItem ); } diff --git a/include/eda_item.h b/include/eda_item.h index b3297a13e0..254264a6b7 100644 --- a/include/eda_item.h +++ b/include/eda_item.h @@ -144,7 +144,7 @@ public: EDA_ITEM_FLAGS GetEditFlags() const { - constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVING | IS_DRAGGING + constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVING | IS_DRAGGING | IS_BROKEN | IS_CHANGED | STRUCT_DELETED ); return m_flags & mask; diff --git a/include/eda_item_flags.h b/include/eda_item_flags.h index e921027bc4..9eba772260 100644 --- a/include/eda_item_flags.h +++ b/include/eda_item_flags.h @@ -39,7 +39,7 @@ #define IN_EDIT (1 << 2) ///< Item currently edited #define IS_MOVING (1 << 3) ///< Item being moved #define IS_NEW (1 << 4) ///< New item, just created - +#define IS_BROKEN (1 << 5) ///< Is a segment just broken by BreakSegment #define IS_DRAGGING (1 << 6) ///< Item being dragged #define IS_DELETED (1 << 7)