gerbview enhancement: complements

This commit is contained in:
CHARRAS 2007-11-02 10:14:12 +00:00
parent bcd7a7395e
commit b9049c506f
2 changed files with 14 additions and 6 deletions

View File

@ -191,8 +191,6 @@ void WinEDA_GerberFrame::Erase_Textes_Pcb( wxDC* DC, bool query )
void WinEDA_GerberFrame::Erase_Current_Layer( wxDC* DC, bool query )
/*******************************************************************/
{
TRACK* pt_segm;
BOARD_ITEM* PtNext;
int layer = GetScreen()->m_Active_Layer;
wxString msg;
@ -200,8 +198,9 @@ void WinEDA_GerberFrame::Erase_Current_Layer( wxDC* DC, bool query )
if( query && !IsOK( this, msg ) )
return;
/* Marquage des pistes a effacer */
for( pt_segm = m_Pcb->m_Track; pt_segm != NULL; pt_segm = (TRACK*) PtNext )
/* Delete tracks (spots and lines) */
TRACK* PtNext;
for( TRACK* pt_segm = m_Pcb->m_Track; pt_segm != NULL; pt_segm = (TRACK*) PtNext )
{
PtNext = pt_segm->Next();
if( pt_segm->GetLayer() != layer )
@ -209,6 +208,15 @@ void WinEDA_GerberFrame::Erase_Current_Layer( wxDC* DC, bool query )
pt_segm->DeleteStructure();
}
/* Delete polygons */
SEGZONE* Nextzone;
for( SEGZONE* zone = m_Pcb->m_Zone; zone != NULL; zone = Nextzone )
{
Nextzone = zone->Next();
if( zone->GetLayer() != layer )
continue;
zone->DeleteStructure();
}
ScreenPcb->SetModify();
ScreenPcb->SetRefreshReq();
}

View File

@ -88,8 +88,8 @@ int id = event.GetId();
case ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH:
if ( m_OptionsToolBar->GetToolState(id) ) // Polygons filled asked
g_DisplayPolygonsModeSketch = 0;
else g_DisplayPolygonsModeSketch = 1;
g_DisplayPolygonsModeSketch = 1;
else g_DisplayPolygonsModeSketch = 0;
DrawPanel->Refresh(TRUE);
break;