eeschema: Re-add auto-wire removal
Somewhere during v5 rc cycle, the trimming of wires laid over simple
components was removed. The wires were still removed as soon as the
user moved the component again. This corrects the first behavior to
intended action for simple components.
Fixes: lp:1794019
* https://bugs.launchpad.net/kicad/+bug/1794019
(cherry picked from commit 9831a14ef3
)
This commit is contained in:
parent
1253020a8b
commit
618374db88
|
@ -332,6 +332,25 @@ void SCH_EDIT_FRAME::EndSegment()
|
|||
|
||||
// Correct and remove segments that need to be merged.
|
||||
SchematicCleanUp( true );
|
||||
|
||||
for( auto item = GetScreen()->GetDrawItems(); item; item = item->Next() )
|
||||
{
|
||||
if( item->Type() != SCH_COMPONENT_T )
|
||||
continue;
|
||||
|
||||
std::vector< wxPoint > pts;
|
||||
item->GetConnectionPoints( pts );
|
||||
std::remove_if( pts.begin(), pts.end(), [ segment ]( const wxPoint& aPt )
|
||||
{ return segment->IsEndPoint( aPt ); } );
|
||||
|
||||
if( pts.size() > 2 )
|
||||
continue;
|
||||
|
||||
for( auto i = pts.begin(); i != pts.end(); i++ )
|
||||
for( auto j = i + 1; j != pts.end(); j++ )
|
||||
TrimWire( *i, *j, true );
|
||||
}
|
||||
|
||||
for( auto i : new_ends )
|
||||
{
|
||||
if( screen->IsJunctionNeeded( i, true ) )
|
||||
|
@ -486,10 +505,9 @@ bool SCH_EDIT_FRAME::TrimWire( const wxPoint& aStart, const wxPoint& aEnd, bool
|
|||
{
|
||||
next_item = item->Next();
|
||||
|
||||
// Don't remove wires that are already deleted, are currently being
|
||||
// dragged or are just created
|
||||
// Don't remove wires that are already deleted or are currently being dragged
|
||||
if( item->GetFlags() &
|
||||
( STRUCT_DELETED | IS_DRAGGED | IS_NEW | IS_MOVED | SKIP_STRUCT ) )
|
||||
( STRUCT_DELETED | IS_DRAGGED | IS_MOVED | SKIP_STRUCT ) )
|
||||
continue;
|
||||
|
||||
if( item->Type() != SCH_LINE_T || item->GetLayer() != LAYER_WIRE )
|
||||
|
|
Loading…
Reference in New Issue