Expose text size for SCH_FIELDs.

This commit is contained in:
Jeff Young 2024-02-27 17:48:09 +00:00
parent a5fda819eb
commit 2dce618f9f
2 changed files with 7 additions and 0 deletions

View File

@ -1402,6 +1402,10 @@ static struct SCH_FIELD_DESC
propMgr.Mask( TYPE_HASH( SCH_FIELD ), TYPE_HASH( EDA_TEXT ), _HKI( "Width" ) );
propMgr.Mask( TYPE_HASH( SCH_FIELD ), TYPE_HASH( EDA_TEXT ), _HKI( "Height" ) );
propMgr.AddProperty( new PROPERTY<SCH_FIELD, int>( _HKI( "Text Size" ),
&SCH_FIELD::SetSchTextSize, &SCH_FIELD::GetSchTextSize, PROPERTY_DISPLAY::PT_SIZE ),
_( "Text Properties" ) );
propMgr.Mask( TYPE_HASH( SCH_FIELD ), TYPE_HASH( EDA_TEXT ), _HKI( "Orientation" ) );
auto isNotNamedVariable =

View File

@ -152,6 +152,9 @@ public:
return name.Trim().empty() && value.Trim().empty();
}
int GetSchTextSize() const { return GetTextWidth(); }
void SetSchTextSize( int aSize ) { SetTextSize( VECTOR2I( aSize, aSize ) ); }
COLOR4D GetFieldColor() const;
void SetLastResolvedState( const SCH_ITEM* aItem ) override