EDA_TEXT Get/SetTextSize should use VECTOR2I

This commit is contained in:
Marek Roszko 2022-05-14 08:12:03 -04:00
parent 5c7a79e287
commit 88c7322a0d
7 changed files with 12 additions and 13 deletions

View File

@ -344,7 +344,7 @@ void EDA_TEXT::SetLineSpacing( double aLineSpacing )
} }
void EDA_TEXT::SetTextSize( const wxSize& aNewSize ) void EDA_TEXT::SetTextSize( const VECTOR2I& aNewSize )
{ {
m_attributes.m_Size = aNewSize; m_attributes.m_Size = aNewSize;
ClearRenderCache(); ClearRenderCache();

View File

@ -530,7 +530,7 @@ wxString FIELDS_GRID_TABLE<T>::GetValue( int aRow, int aCol )
return StringFromBool( field.IsBold() ); return StringFromBool( field.IsBold() );
case FDC_TEXT_SIZE: case FDC_TEXT_SIZE:
return StringFromValue( m_frame->GetUserUnits(), field.GetTextSize().GetHeight(), true ); return StringFromValue( m_frame->GetUserUnits(), field.GetTextHeight(), true );
case FDC_ORIENTATION: case FDC_ORIENTATION:
if( field.GetTextAngle().IsHorizontal() ) if( field.GetTextAngle().IsHorizontal() )

View File

@ -2827,9 +2827,9 @@ LIB_SYMBOL* CADSTAR_SCH_ARCHIVE_LOADER::getScaledLibPart( const LIB_SYMBOL* aSym
}; };
auto scaleSize = auto scaleSize =
[&]( wxSize aSize ) -> wxSize [&]( VECTOR2I aSize ) -> VECTOR2I
{ {
return wxSize( scaleLen( aSize.x ), scaleLen( aSize.y ) ); return VECTOR2I( scaleLen( aSize.x ), scaleLen( aSize.y ) );
}; };
LIB_ITEMS_CONTAINER& items = retval->GetDrawItems(); LIB_ITEMS_CONTAINER& items = retval->GetDrawItems();

View File

@ -569,7 +569,7 @@ int SCH_SHEET::GetPenWidth() const
void SCH_SHEET::AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) void SCH_SHEET::AutoplaceFields( SCH_SCREEN* aScreen, bool aManual )
{ {
wxSize textSize = m_fields[ SHEETNAME ].GetTextSize(); VECTOR2I textSize = m_fields[SHEETNAME].GetTextSize();
int borderMargin = KiROUND( GetPenWidth() / 2.0 ) + 4; int borderMargin = KiROUND( GetPenWidth() / 2.0 ) + 4;
int margin = borderMargin + KiROUND( std::max( textSize.x, textSize.y ) * 0.5 ); int margin = borderMargin + KiROUND( std::max( textSize.x, textSize.y ) * 0.5 );

View File

@ -192,9 +192,8 @@ public:
void SetLineSpacing( double aLineSpacing ); void SetLineSpacing( double aLineSpacing );
double GetLineSpacing() const { return m_attributes.m_LineSpacing; } double GetLineSpacing() const { return m_attributes.m_LineSpacing; }
void SetTextSize( const wxSize& aNewSize ); void SetTextSize( const VECTOR2I& aNewSize );
wxSize GetTextSize() const { return wxSize( m_attributes.m_Size.x, VECTOR2I GetTextSize() const { return m_attributes.m_Size; }
m_attributes.m_Size.y ); }
void SetTextWidth( int aWidth ); void SetTextWidth( int aWidth );
int GetTextWidth() const { return m_attributes.m_Size.x; } int GetTextWidth() const { return m_attributes.m_Size.x; }

View File

@ -76,7 +76,7 @@ public:
bool m_Visible = true; bool m_Visible = true;
bool m_Mirrored = false; bool m_Mirrored = false;
bool m_Multiline = true; bool m_Multiline = true;
VECTOR2D m_Size; VECTOR2I m_Size;
/** /**
* If true, keep rotation angle between -90...90 degrees for readability * If true, keep rotation angle between -90...90 degrees for readability

View File

@ -1678,7 +1678,7 @@ void EAGLE_PLUGIN::orientFPText( FOOTPRINT* aFootprint, const EELEMENT& e, FP_TE
if( a.ratio ) if( a.ratio )
ratio = *a.ratio; ratio = *a.ratio;
wxSize fontz = aFPText->GetTextSize(); VECTOR2I fontz = aFPText->GetTextSize();
int textThickness = KiROUND( fontz.y * ratio / 100 ); int textThickness = KiROUND( fontz.y * ratio / 100 );
aFPText->SetTextThickness( textThickness ); aFPText->SetTextThickness( textThickness );