Get rid of asserts when adding line segments.

This commit is contained in:
Jeff Young 2018-09-08 19:07:41 +01:00
parent 1a0f3b79cc
commit 2b6e3de90e
1 changed files with 6 additions and 9 deletions

View File

@ -540,6 +540,7 @@ bool SCH_BASE_FRAME::HandleBlockBegin( wxDC* aDC, EDA_KEY aKey, const wxPoint& a
return true; return true;
} }
void EDA_DRAW_FRAME::createCanvas() void EDA_DRAW_FRAME::createCanvas()
{ {
m_canvas = new SCH_DRAW_PANEL( this, wxID_ANY, wxPoint( 0, 0 ), m_FrameSize, m_canvas = new SCH_DRAW_PANEL( this, wxID_ANY, wxPoint( 0, 0 ), m_FrameSize,
@ -558,27 +559,23 @@ void SCH_BASE_FRAME::AddToScreen( SCH_ITEM* aItem )
GetCanvas()->GetView()->Add( aItem ); GetCanvas()->GetView()->Add( aItem );
} }
void SCH_BASE_FRAME::AddToScreen( DLIST<SCH_ITEM>& aItems ) void SCH_BASE_FRAME::AddToScreen( DLIST<SCH_ITEM>& aItems )
{ {
std::vector<SCH_ITEM*> tmp; for( SCH_ITEM* item = aItems.begin(); item; item = item->Next() )
SCH_ITEM* itemList = aItems.begin(); GetCanvas()->GetView()->Add( item );
while( itemList )
{
itemList->SetList( nullptr );
GetCanvas()->GetView()->Add( itemList );
itemList = itemList->Next();
}
GetScreen()->Append( aItems ); GetScreen()->Append( aItems );
} }
void SCH_BASE_FRAME::RemoveFromScreen( SCH_ITEM* aItem ) void SCH_BASE_FRAME::RemoveFromScreen( SCH_ITEM* aItem )
{ {
GetCanvas()->GetView()->Remove( aItem ); GetCanvas()->GetView()->Remove( aItem );
GetScreen()->Remove( aItem ); GetScreen()->Remove( aItem );
} }
void SCH_BASE_FRAME::SyncView() void SCH_BASE_FRAME::SyncView()
{ {
auto screen = GetScreen(); auto screen = GetScreen();