Eeschema: Autoplace fields offset correction

No longer count fields without 'Allow automatic placement'
toward the Autoplace offset.

Fixes https://gitlab.com/kicad/code/kicad/issues/16588
This commit is contained in:
Martin Berglund 2024-01-24 00:24:16 +00:00 committed by Seth Hillbrand
parent ea7176d466
commit ddc2092dac
1 changed files with 7 additions and 13 deletions

View File

@ -194,24 +194,18 @@ protected:
int max_field_width = 0; int max_field_width = 0;
int total_height = 0; int total_height = 0;
std::vector<SCH_FIELD*> visibleFields;
for( SCH_FIELD* field : m_fields ) for( SCH_FIELD* field : m_fields )
{ {
if( field->IsVisible() ) if( !field->IsVisible() || !field->CanAutoplace() )
visibleFields.push_back( field );
}
for( SCH_FIELD* field : visibleFields )
{
if( field->CanAutoplace() )
{ {
if( m_symbol->GetTransform().y1 ) continue;
field->SetTextAngle( ANGLE_VERTICAL );
else
field->SetTextAngle( ANGLE_HORIZONTAL );
} }
if( m_symbol->GetTransform().y1 )
field->SetTextAngle( ANGLE_VERTICAL );
else
field->SetTextAngle( ANGLE_HORIZONTAL );
BOX2I bbox = field->GetBoundingBox(); BOX2I bbox = field->GetBoundingBox();
int field_width = bbox.GetWidth(); int field_width = bbox.GetWidth();
int field_height = bbox.GetHeight(); int field_height = bbox.GetHeight();