EEschema: fix incorrect (missing) init of main layer of SCH_SHEET fields

These fields were not drawn when drawing a hierarchical sheet.
This commit is contained in:
jean-pierre charras 2024-04-15 09:56:19 +02:00
parent d13100e7f2
commit ac36feda41
1 changed files with 10 additions and 1 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -523,6 +523,15 @@ SCH_LAYER_ID SCH_FIELD::GetDefaultLayer() const
else if( m_id == VALUE_FIELD )
return LAYER_VALUEPART;
}
else if( m_parent && m_parent->Type() == SCH_SHEET_T )
{
if( m_id == SHEETNAME )
return LAYER_SHEETNAME;
else if( m_id == SHEETFILENAME )
return LAYER_SHEETFILENAME;
else
return LAYER_SHEETFIELDS;
}
else if( m_parent && m_parent->Type() == SCH_LABEL_T )
{
if( GetCanonicalName() == wxT( "Netclass" ) )