Skip to content

Commit

Permalink
Customize one card font size, see: #32
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed Dec 18, 2024
1 parent de4b218 commit 738e149
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/common/model/RepresentationType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class RepresentationType extends EnumerationValue {
NumberPairsColors.locationSumColorProperty,
NumberPairsColors.locationLeftAddendColorProperty,
NumberPairsColors.locationRightAddendColorProperty,
new OneCard( ICON_MAX_WIDTH, ICON_MAX_HEIGHT )
new OneCard( ICON_MAX_WIDTH, ICON_MAX_HEIGHT, 20 )
);
public static readonly KITTENS = new RepresentationType(
'kittens',
Expand Down
2 changes: 1 addition & 1 deletion js/common/view/LocationCountingObjectNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class LocationCountingObjectNode extends Node {
} );

// Create the one card.
const oneCard = new OneCard( IMAGE_WIDTH, ONE_CARD_HEIGHT, {
const oneCard = new OneCard( IMAGE_WIDTH, ONE_CARD_HEIGHT, 40, {
visibleProperty: DerivedProperty.valueEqualsConstant( countingRepresentationTypeProperty, RepresentationType.ONE_CARDS )
} );

Expand Down
4 changes: 2 additions & 2 deletions js/common/view/OneCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ type SelfOptions = EmptySelfOptions;
type OneCardOptions = SelfOptions & StrictOmit<NodeOptions, 'children'>;
export default class OneCard extends Node {

public constructor( cardWidth: number, cardHeight: number, providedOptions?: OneCardOptions ) {
public constructor( cardWidth: number, cardHeight: number, fontSize: number, providedOptions?: OneCardOptions ) {
const background = new Rectangle( 0, 0, cardWidth, cardHeight, {
fill: 'white',
stroke: 'black',
cornerRadius: 5
} );
const numberOne = new Text( '1', {
font: new PhetFont( 40 ),
font: new PhetFont( fontSize ),
center: background.center
} );

Expand Down

0 comments on commit 738e149

Please sign in to comment.