Init zone type when creating in convert tool

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9918
This commit is contained in:
Jon Evans 2021-12-09 18:20:30 -05:00
parent 196571d004
commit 62e6f542ed
1 changed files with 10 additions and 0 deletions

View File

@ -218,15 +218,25 @@ int CONVERT_TOOL::CreatePolys( const TOOL_EVENT& aEvent )
bool nonCopper = IsNonCopperLayer( destLayer );
zoneInfo.m_Layers.reset().set( destLayer );
zoneInfo.m_Name.Empty();
int ret;
if( aEvent.IsAction( &PCB_ACTIONS::convertToKeepout ) )
{
zoneInfo.SetIsRuleArea( true );
ret = InvokeRuleAreaEditor( frame, &zoneInfo );
}
else if( nonCopper )
{
zoneInfo.SetIsRuleArea( false );
ret = InvokeNonCopperZonesEditor( frame, &zoneInfo );
}
else
{
zoneInfo.SetIsRuleArea( false );
ret = InvokeCopperZonesEditor( frame, &zoneInfo );
}
if( ret == wxID_CANCEL )
return 0;