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.
This commit is contained in:
Jon Evans 2025-05-26 15:19:10 -04:00
parent d928a2a0e3
commit 81ea108d8c
2 changed files with 3 additions and 3 deletions

View File

@ -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" );

View File

@ -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();
}