From cbd13c7127545b8c3b458de8abfb254b32a7e3a8 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 7 Nov 2018 14:22:29 +0000 Subject: [PATCH] Show dangling pins when moving items; don't when dragging. Fixes: lp:1801962 * https://bugs.launchpad.net/kicad/+bug/1801962 Fixes: lp:1801959 * https://bugs.launchpad.net/kicad/+bug/1801959 --- eeschema/block.cpp | 25 ++++++++++++++----------- eeschema/schedit.cpp | 3 +++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/eeschema/block.cpp b/eeschema/block.cpp index 64da3309c2..6589ac83fe 100644 --- a/eeschema/block.cpp +++ b/eeschema/block.cpp @@ -254,19 +254,22 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* aDC ) nextcmd = true; block->SetState( STATE_BLOCK_MOVE ); - // Mark dangling pins at the edges of the block: - std::vector internalPoints; - - for( unsigned i = 0; i < block->GetCount(); ++i ) + if( block->GetCommand() != BLOCK_DRAG && block->GetCommand() != BLOCK_DRAG_ITEM ) { - auto item = static_cast( block->GetItem( i ) ); - item->GetEndPoints( internalPoints ); - } + // Mark dangling pins at the edges of the block: + std::vector internalPoints; - for( unsigned i = 0; i < block->GetCount(); ++i ) - { - auto item = static_cast( block->GetItem( i ) ); - item->UpdateDanglingState( internalPoints ); + for( unsigned i = 0; i < block->GetCount(); ++i ) + { + auto item = static_cast( block->GetItem( i ) ); + item->GetEndPoints( internalPoints ); + } + + for( unsigned i = 0; i < block->GetCount(); ++i ) + { + auto item = static_cast( block->GetItem( i ) ); + item->UpdateDanglingState( internalPoints ); + } } m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines ); diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index bfde97491b..315d5fefbf 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -772,6 +772,9 @@ void SCH_EDIT_FRAME::PrepareMoveItem( SCH_ITEM* aItem ) SetUndoItem( aItem ); } + std::vector emptySet; + aItem->UpdateDanglingState( emptySet ); + aItem->SetFlags( IS_MOVED ); if( aItem->Type() == SCH_FIELD_T && aItem->GetParent()->Type() == SCH_COMPONENT_T )