Commit 667a6498 authored by charras's avatar charras

solved pcbnew: minor bug when only one copper layer selected: zone properties...

solved pcbnew: minor bug when only one copper layer selected: zone properties layer list displayed component layer instead of copper layer
parent 6f841123
No preview for this file type
This diff is collapsed.
...@@ -257,7 +257,7 @@ void WinEDA_ZoneFrame::OnInitDialog( wxInitDialogEvent& event ) ...@@ -257,7 +257,7 @@ void WinEDA_ZoneFrame::OnInitDialog( wxInitDialogEvent& event )
BOARD* board = m_Parent->m_Pcb; BOARD* board = m_Parent->m_Pcb;
SetFont( *g_DialogFont ); SetFont( *g_DialogFont );
SetFocus(); // Required under wxGTK if we want to demiss the dialog with the ESC key SetFocus(); // Required under wxGTK if we want to demiss the dialog with the ESC key
wxString title = _( "Zone clearance value:" ) + ReturnUnitSymbol( g_UnitMetric ); wxString title = _( "Zone clearance value:" ) + ReturnUnitSymbol( g_UnitMetric );
...@@ -295,7 +295,7 @@ void WinEDA_ZoneFrame::OnInitDialog( wxInitDialogEvent& event ) ...@@ -295,7 +295,7 @@ void WinEDA_ZoneFrame::OnInitDialog( wxInitDialogEvent& event )
} }
if( grid_routing == 0 ) // No Grid: fill with polygons if( grid_routing == 0 ) // No Grid: fill with polygons
selection = 4; selection = 4;
m_GridCtrl->SetSelection( selection ); m_GridCtrl->SetSelection( selection );
if( m_Zone_Container ) if( m_Zone_Container )
...@@ -353,13 +353,14 @@ void WinEDA_ZoneFrame::OnInitDialog( wxInitDialogEvent& event ) ...@@ -353,13 +353,14 @@ void WinEDA_ZoneFrame::OnInitDialog( wxInitDialogEvent& event )
break; break;
} }
/* build copper layers list */
int layer_cnt = board->GetCopperLayerCount(); int layer_cnt = board->GetCopperLayerCount();
for( int ii = 0; ii < board->GetCopperLayerCount(); ii++ ) for( int ii = 0; ii < board->GetCopperLayerCount(); ii++ )
{ {
wxString msg; wxString msg;
int layer_number = COPPER_LAYER_N; int layer_number = COPPER_LAYER_N;
if( layer_cnt == 0 || ii < layer_cnt - 1 ) if( layer_cnt <= 1 || ii < layer_cnt - 1 )
layer_number = ii; layer_number = ii;
else if( ii == layer_cnt - 1 ) else if( ii == layer_cnt - 1 )
layer_number = LAYER_CMP_N; layer_number = LAYER_CMP_N;
......
...@@ -898,6 +898,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v ...@@ -898,6 +898,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
} }
else else
{ {
zone_container->m_FilledPolysList.clear();
zone_container->m_GridFillValue = g_GridRoutingSize; zone_container->m_GridFillValue = g_GridRoutingSize;
error_level = zone_container->Fill_Zone( this, DC, verbose ); error_level = zone_container->Fill_Zone( this, DC, verbose );
} }
...@@ -935,6 +936,7 @@ int WinEDA_PcbFrame::Fill_All_Zones( wxDC* DC, bool verbose ) ...@@ -935,6 +936,7 @@ int WinEDA_PcbFrame::Fill_All_Zones( wxDC* DC, bool verbose )
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{ {
zone_container = m_Pcb->GetArea( ii ); zone_container = m_Pcb->GetArea( ii );
zone_container->m_FilledPolysList.clear();
error_level = Fill_Zone( NULL, zone_container, verbose ); error_level = Fill_Zone( NULL, zone_container, verbose );
if( error_level && !verbose ) if( error_level && !verbose )
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment