Add a workaround for bus unfolding without real-time connectivity

Fixes: lp:1822728
* https://bugs.launchpad.net/kicad/+bug/1822728
This commit is contained in:
Jon Evans 2019-04-11 00:17:07 -04:00
parent 3b46253056
commit 232b1c799f
2 changed files with 13 additions and 1 deletions

View File

@ -191,7 +191,8 @@ void SCH_EDIT_FRAME::BeginSegment( int type )
segment = (SCH_LINE*) GetScreen()->GetCurItem();
if( segment ) // a current item exists, but not necessary a currently edited item
{
if( !segment->GetFlags() || ( segment->Type() != SCH_LINE_T ) )
if( !segment->GetFlags() || ( segment->Type() != SCH_LINE_T ) ||
( segment->GetLayer() != type ) )
{
if( segment->GetFlags() )
wxLogDebug( wxT( "BeginSegment: item->GetFlags()== %X" ), segment->GetFlags() );

View File

@ -765,6 +765,17 @@ void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, SCH_EDIT_FRAME* frame )
AddMenuItem( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Bus" ), KiBitmap( break_bus_xpm ) );
// TODO(JE) remove once real-time is enabled
#ifndef CONNECTIVITY_REAL_TIME
frame->RecalculateConnections();
// Have to pick up the pointer again because it may have been changed by SchematicCleanUp
bool actionCancelled = false;
Bus = dynamic_cast<SCH_LINE*>( frame->LocateAndShowItem( pos, SCH_COLLECTOR::AllItemsButPins,
0, &actionCancelled ) );
wxASSERT( Bus );
#endif
// Bus unfolding menu (only available if bus is properly defined)
auto connection = Bus->Connection( *g_CurrentSheet );