Skip to content

Commit

Permalink
include maxCustomMass in range, #409
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 3, 2024
1 parent cb178dd commit cb5d7c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/common/view/MaterialMassVolumeControlNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ export default class MaterialMassVolumeControlNode extends MaterialControlNode {
valueComparisonStrategy: 'equalsFunction'
} );

const maxMass = Math.max( ...[ options.maxMass, options.maxCustomMass, options.highDensityMaxMass ].filter( x => typeof x === 'number' ) );

// passed to the NumberControl
const numberControlMassProperty = new GuardedNumberProperty( massProperty.value, {
range: new Range( options.minMass, options.highDensityMaxMass || options.maxMass ),
range: new Range( options.minMass, maxMass ),
units: 'kg',
tandem: massNumberControlContainerTandem.createTandem( 'massProperty' ),
phetioFeatured: true,
Expand Down

1 comment on commit cb5d7c1

@zepumph
Copy link
Member Author

@zepumph zepumph commented on cb5d7c1 Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.