Refill legacy zone fills on open
Previous check only looked for the existence of a new (as of v6) flag
that controlled which strategy we took. Previous versions did not write
this flag and so will not hit the check. This works around a missing
version bump from when the feature was introduced.
(cherry picked from commit 6a09cf3551
)
This commit is contained in:
parent
45d496bd01
commit
e4a80d887a
|
@ -2171,34 +2171,8 @@ void PCB_PARSER::parseSetup()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_filled_areas_thickness:
|
case T_filled_areas_thickness:
|
||||||
if( parseBool() )
|
// Ignore this value, it is not used anymore
|
||||||
{
|
parseBool();
|
||||||
if( m_showLegacy5ZoneWarning )
|
|
||||||
{
|
|
||||||
if( Pgm().IsGUI() )
|
|
||||||
{
|
|
||||||
// Thick outline fill mode no longer supported. Make sure user is OK with
|
|
||||||
// converting fills.
|
|
||||||
KIDIALOG dlg( nullptr,
|
|
||||||
_( "The legacy zone fill strategy is no longer "
|
|
||||||
"supported.\nConvert zones to smoothed polygon "
|
|
||||||
"fills?" ),
|
|
||||||
_( "Legacy Zone Warning" ), wxYES_NO | wxICON_WARNING );
|
|
||||||
|
|
||||||
dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
|
|
||||||
|
|
||||||
if( dlg.ShowModal() == wxID_NO )
|
|
||||||
THROW_IO_ERROR( wxT( "CANCEL" ) );
|
|
||||||
|
|
||||||
m_showLegacy5ZoneWarning = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
THROW_IO_ERROR( wxT( "Legacy zone fill strategy was found, open the project in the PCB Editor to resolve" ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NeedRIGHT();
|
NeedRIGHT();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -5558,6 +5532,17 @@ ZONE* PCB_PARSER::parseZONE( BOARD_ITEM_CONTAINER* aParent )
|
||||||
|
|
||||||
zone->SetAssignedPriority( 0 );
|
zone->SetAssignedPriority( 0 );
|
||||||
|
|
||||||
|
bool isLegacy = false;
|
||||||
|
|
||||||
|
if( m_requiredVersion < 20210606 )
|
||||||
|
{
|
||||||
|
// A new zone fill strategy was added in v6, so we need to know if we're parsing
|
||||||
|
// a file that was written before that date. Note that the change was implemented as
|
||||||
|
// a new parameter without changing the version number, so we need to check for the
|
||||||
|
// presence of the new parameter instead of just the version number.
|
||||||
|
isLegacy = true;
|
||||||
|
}
|
||||||
|
|
||||||
// This is the default for board files:
|
// This is the default for board files:
|
||||||
zone->SetIslandRemovalMode( ISLAND_REMOVAL_MODE::ALWAYS );
|
zone->SetIslandRemovalMode( ISLAND_REMOVAL_MODE::ALWAYS );
|
||||||
|
|
||||||
|
@ -5674,24 +5659,9 @@ ZONE* PCB_PARSER::parseZONE( BOARD_ITEM_CONTAINER* aParent )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_filled_areas_thickness:
|
case T_filled_areas_thickness:
|
||||||
if( parseBool() )
|
|
||||||
{
|
|
||||||
if( m_showLegacy5ZoneWarning && m_queryUserCallback )
|
|
||||||
{
|
|
||||||
if( !m_queryUserCallback(
|
|
||||||
_( "Legacy Zone Warning" ), wxICON_WARNING,
|
|
||||||
_( "The legacy zone fill strategy is no longer supported.\n"
|
|
||||||
"Convert zones to smoothed polygon fills?" ),
|
|
||||||
_( "Convert" ) ) )
|
|
||||||
{
|
|
||||||
THROW_IO_ERROR( wxT( "CANCEL" ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_showLegacy5ZoneWarning = false;
|
if( parseBool() )
|
||||||
zone->SetFlags( CANDIDATE );
|
isLegacy = true;
|
||||||
dropFilledPolygons = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
NeedRIGHT();
|
NeedRIGHT();
|
||||||
break;
|
break;
|
||||||
|
@ -6125,6 +6095,26 @@ ZONE* PCB_PARSER::parseZONE( BOARD_ITEM_CONTAINER* aParent )
|
||||||
zone->SetBorderDisplayStyle( hatchStyle, hatchPitch, true );
|
zone->SetBorderDisplayStyle( hatchStyle, hatchPitch, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( isLegacy && !zone->GetIsRuleArea() )
|
||||||
|
{
|
||||||
|
if( m_showLegacy5ZoneWarning && m_queryUserCallback )
|
||||||
|
{
|
||||||
|
if( !m_queryUserCallback(
|
||||||
|
_( "Legacy Zone Warning" ), wxICON_WARNING,
|
||||||
|
_( "The legacy zone fill strategy is no longer supported.\n"
|
||||||
|
"Convert zones to smoothed polygon fills?" ),
|
||||||
|
_( "Convert" ) ) )
|
||||||
|
{
|
||||||
|
THROW_IO_ERROR( wxT( "CANCEL" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_showLegacy5ZoneWarning = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
zone->SetFlags( CANDIDATE );
|
||||||
|
dropFilledPolygons = true;
|
||||||
|
}
|
||||||
|
|
||||||
if( addedFilledPolygons && !dropFilledPolygons )
|
if( addedFilledPolygons && !dropFilledPolygons )
|
||||||
{
|
{
|
||||||
for( auto& pair : pts )
|
for( auto& pair : pts )
|
||||||
|
|
Loading…
Reference in New Issue