Skip to content

Commit

Permalink
Add maxWidth for gravity and fluid fallback text, see #394 and #418
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Oct 2, 2024
1 parent b1e3776 commit 1427bd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion js/common/view/FluidDensityControlNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ type ParentOptions = WithRequired<Partial<ComboNumberControlOptions<Material>>,
type DensityControlNodeOptions = SelfOptions & ParentOptions;

const FALLBACK_NODE = new Text( DensityBuoyancyCommonStrings.whatIsTheFluidDensityStringProperty, {
font: new PhetFont( 14 )
font: new PhetFont( 14 ),

// estimate as the same max width as the combo box below
maxWidth: 210
} );

export default class FluidDensityControlNode extends ComboNumberControl<Material> {
Expand Down
5 changes: 4 additions & 1 deletion js/common/view/GravityControlNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import GravityProperty from '../model/GravityProperty.js';
import ComboNumberControl from './ComboNumberControl.js';

const FALLBACK_NODE = new Text( DensityBuoyancyCommonStrings.whatIsTheValueOfGravityStringProperty, {
font: new PhetFont( 14 )
font: new PhetFont( 14 ),

// estimate as the same max width as the combo box below
maxWidth: 210
} );

export default class GravityControlNode extends ComboNumberControl<Gravity> {
Expand Down

0 comments on commit 1427bd4

Please sign in to comment.