Add zone filler tests.
One test has pads of a bunch of different shapes and provokes some errors to make sure they're caught. The others are all past issues with the zone filler to make sure we don't suffer any regressions. (They should all just pass with no DRC errors.)
This commit is contained in:
+29
-16
@@ -178,7 +178,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
||||
}
|
||||
}
|
||||
|
||||
if( boardItem->Type() != PCB_NETINFO_T )
|
||||
if( view && boardItem->Type() != PCB_NETINFO_T )
|
||||
view->Add( boardItem );
|
||||
|
||||
break;
|
||||
@@ -221,7 +221,8 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
||||
if( parentGroup && !( parentGroup->GetFlags() & STRUCT_DELETED ) )
|
||||
parentGroup->RemoveItem( boardItem );
|
||||
|
||||
view->Remove( boardItem );
|
||||
if( view )
|
||||
view->Remove( boardItem );
|
||||
|
||||
if( !( changeFlags & CHT_DONE ) )
|
||||
{
|
||||
@@ -245,7 +246,8 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
||||
case PCB_TARGET_T: // a target (graphic item)
|
||||
case PCB_MARKER_T: // a marker used to show something
|
||||
case PCB_ZONE_T:
|
||||
view->Remove( boardItem );
|
||||
if( view )
|
||||
view->Remove( boardItem );
|
||||
|
||||
if( !( changeFlags & CHT_DONE ) )
|
||||
{
|
||||
@@ -261,7 +263,10 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
||||
wxASSERT( !m_isFootprintEditor );
|
||||
|
||||
FOOTPRINT* footprint = static_cast<FOOTPRINT*>( boardItem );
|
||||
view->Remove( footprint );
|
||||
|
||||
if( view )
|
||||
view->Remove( footprint );
|
||||
|
||||
footprint->ClearFlags();
|
||||
|
||||
if( !( changeFlags & CHT_DONE ) )
|
||||
@@ -273,7 +278,8 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
||||
break;
|
||||
|
||||
case PCB_GROUP_T:
|
||||
view->Remove( boardItem );
|
||||
if( view )
|
||||
view->Remove( boardItem );
|
||||
|
||||
if( !( changeFlags & CHT_DONE ) )
|
||||
{
|
||||
@@ -315,15 +321,19 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
||||
connectivity->MarkItemNetAsDirty( static_cast<BOARD_ITEM*>( ent.m_copy ) );
|
||||
|
||||
connectivity->Update( boardItem );
|
||||
view->Update( boardItem );
|
||||
|
||||
if( m_isFootprintEditor )
|
||||
if( view )
|
||||
{
|
||||
static_cast<FOOTPRINT*>( boardItem )->RunOnChildren(
|
||||
[&]( BOARD_ITEM* aChild )
|
||||
{
|
||||
view->Update( aChild );
|
||||
});
|
||||
view->Update( boardItem );
|
||||
|
||||
if( m_isFootprintEditor )
|
||||
{
|
||||
static_cast<FOOTPRINT*>( boardItem )->RunOnChildren(
|
||||
[&]( BOARD_ITEM* aChild )
|
||||
{
|
||||
view->Update( aChild );
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
itemsChanged.push_back( boardItem );
|
||||
@@ -359,7 +369,9 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
||||
|
||||
connectivity->RecalculateRatsnest( this );
|
||||
connectivity->ClearDynamicRatsnest();
|
||||
frame->GetCanvas()->RedrawRatsnest();
|
||||
|
||||
if( frame )
|
||||
frame->GetCanvas()->RedrawRatsnest();
|
||||
|
||||
if( m_changes.size() > num_changes )
|
||||
{
|
||||
@@ -370,7 +382,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
||||
// This should only be modifications from the connectivity algo
|
||||
wxASSERT( ( ent.m_type & CHT_TYPE ) == CHT_MODIFY );
|
||||
|
||||
auto boardItem = static_cast<BOARD_ITEM*>( ent.m_item );
|
||||
BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( ent.m_item );
|
||||
|
||||
if( aCreateUndoEntry )
|
||||
{
|
||||
@@ -384,7 +396,8 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
||||
delete ent.m_copy;
|
||||
}
|
||||
|
||||
view->Update( boardItem );
|
||||
if( view )
|
||||
view->Update( boardItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -399,7 +412,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
||||
|
||||
if( aSetDirtyBit )
|
||||
frame->OnModify();
|
||||
else
|
||||
else if( frame )
|
||||
frame->Update3DView( true, frame->GetDisplayOptions().m_Live3DRefresh );
|
||||
|
||||
clear();
|
||||
|
||||
Reference in New Issue
Block a user