Expose text size for SCH_FIELDs.

(cherry picked from commit 2dce618f9f)
This commit is contained in:
Jeff Young 2024-02-27 17:48:09 +00:00
parent 985c3ad92a
commit b07d43a24a
2 changed files with 7 additions and 0 deletions

View File

@ -1400,6 +1400,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