mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
EDA_TEXT Get/SetTextSize should use VECTOR2I
This commit is contained in:
parent
5c7a79e287
commit
88c7322a0d
@ -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();
|
||||||
|
@ -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() )
|
||||||
|
@ -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();
|
||||||
|
@ -569,9 +569,9 @@ 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 );
|
||||||
|
|
||||||
if( IsVerticalOrientation() )
|
if( IsVerticalOrientation() )
|
||||||
{
|
{
|
||||||
|
@ -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; }
|
||||||
|
@ -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
|
||||||
|
@ -1678,8 +1678,8 @@ 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 );
|
||||||
if( a.size )
|
if( a.size )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user