Browse Source

Don't bypass empty visibility recovery due to migration

In some situations, loading a project in 8.0 would wipe the
object visibility settings but the local settings also
require a format migration.  The migrator was adding visibility
for the shapes layer in this situation, bypassing the recovery
from having no objects visible.
9.0
Jon Evans 6 months ago
parent
commit
81ea108d8c
  1. 4
      common/project/project_local_settings.cpp
  2. 2
      pcbnew/board.cpp

4
common/project/project_local_settings.cpp

@ -83,7 +83,7 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
{
if( !aVal.is_array() || aVal.empty() )
{
m_VisibleItems = GAL_SET::DefaultVisible();
m_VisibleItems |= UserVisbilityLayers();
return;
}
@ -439,7 +439,7 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
if( Contains( ptr ) )
{
if( At( ptr ).is_array() )
if( At( ptr ).is_array() && !At( ptr ).empty() )
At( ptr ).push_back( LAYER_FILLED_SHAPES - GAL_LAYER_ID_START );
else
At( "board" ).erase( "visible_items" );

2
pcbnew/board.cpp

@ -891,7 +891,7 @@ void BOARD::SetVisibleAlls()
GAL_SET BOARD::GetVisibleElements() const
{
return m_project ? m_project->GetLocalSettings().m_VisibleItems : GAL_SET().set();
return m_project ? m_project->GetLocalSettings().m_VisibleItems : GAL_SET::DefaultVisible();
}

Loading…
Cancel
Save