Skip to content

Commit

Permalink
make the copper end of the battery larger, adjust maxWidth and font f…
Browse files Browse the repository at this point in the history
…or battery voltage, #202
  • Loading branch information
pixelzoom committed Jul 25, 2024
1 parent f8d9b2c commit cffdea3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/common/view/BatteryNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class BatteryNode extends Node {
.addColorStop( 0.3, 'rgb( 222, 218, 215 )' )
.addColorStop( 0.7, 'rgb( 200, 99, 38 )' );

const positiveEndNode = new Rectangle( 0, 0, 0.3 * options.size.width, positiveEndHeight, {
const positiveEndNode = new Rectangle( 0, 0, 0.4 * options.size.width, positiveEndHeight, {
fill: positiveEndGradient,
stroke: options.stroke,
lineWidth: options.lineWidth,
Expand Down
8 changes: 4 additions & 4 deletions js/common/view/DCPowerSupplyNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ export default class DCPowerSupplyNode extends Node {
units: FaradaysElectromagneticLabStrings.units.VStringProperty
} );
const voltsText = new Text( voltsStringProperty, {
font: new PhetFont( 12 ),
font: new PhetFont( 14 ),
fill: FELColors.batteryVoltsColorProperty,
maxWidth: 40,
maxWidth: 28,
tandem: providedOptions.tandem.createTandem( 'voltsText' ),
phetioVisiblePropertyInstrumented: true,
visiblePropertyOptions: {
Expand Down Expand Up @@ -86,10 +86,10 @@ export default class DCPowerSupplyNode extends Node {
[ dcPowerSupply.normalizedCurrentProperty, voltsText.boundsProperty ],
( normalizedCurrent, voltsTextBounds ) => {
if ( normalizedCurrent >= 0 ) {
voltsText.right = batteryNode.right - 10;
voltsText.right = batteryNode.right - 12;
}
else {
voltsText.right = batteryNode.left + 35;
voltsText.right = batteryNode.left + 42; // right justified in the copper section of the battery
}
voltsText.centerY = batteryNode.centerY;
} );
Expand Down

0 comments on commit cffdea3

Please sign in to comment.