Browse Source

SCH_LABEL_BASE::SetPosition(): ensure field positions are also handled.

Fixes #14520
https://gitlab.com/kicad/code/kicad/issues/14520
newinvert
jean-pierre charras 3 years ago
parent
commit
de579af352
  1. 15
      eeschema/sch_label.cpp
  2. 11
      eeschema/sch_label.h

15
eeschema/sch_label.cpp

@ -290,6 +290,21 @@ VECTOR2I SCH_LABEL_BASE::GetSchematicTextOffset( const RENDER_SETTINGS* aSetting
return text_offset;
}
void SCH_LABEL_BASE::SetPosition( const VECTOR2I& aPosition )
{
VECTOR2I offset = aPosition - GetTextPos();
Move( offset );
}
void SCH_LABEL_BASE::Move( const VECTOR2I& aMoveVector )
{
SCH_TEXT::Move( aMoveVector );
for( SCH_FIELD& field : m_fields )
field.Offset( aMoveVector );
}
void SCH_LABEL_BASE::Rotate( const VECTOR2I& aCenter )
{

11
eeschema/sch_label.h

@ -112,17 +112,12 @@ public:
*/
bool IncrementLabel( int aIncrement );
void Move( const VECTOR2I& aMoveVector ) override
{
SCH_TEXT::Move( aMoveVector );
for( SCH_FIELD& field : m_fields )
field.Offset( aMoveVector );
}
void Move( const VECTOR2I& aMoveVector ) override;
void Rotate( const VECTOR2I& aCenter ) override;
void Rotate90( bool aClockwise ) override;
void SetPosition( const VECTOR2I& aPosition ) override;
void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
/**

Loading…
Cancel
Save