Skip to content

Commit

Permalink
improve handling of max width for concentration data, see #246 (comment)
Browse files Browse the repository at this point in the history


(cherry picked from commit 3fca466)
  • Loading branch information
jbphet committed Jan 31, 2023
1 parent ae6a706 commit df92fc6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/common/view/ConcentrationControlPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class ConcentrationControlPanel extends Panel {

let compositionDataNode: CompositionDataNode | null = null;
if ( options.includeCompositionData ) {
compositionDataNode = new CompositionDataNode( concentrationModel.dateProperty );
compositionDataNode = new CompositionDataNode( concentrationModel.dateProperty, width );
contentChildren.push( compositionDataNode );
}

Expand Down Expand Up @@ -422,11 +422,11 @@ class ConcentrationSlider extends VBox {

class CompositionDataNode extends VBox {

public constructor( dateProperty: EnumerationProperty<ConcentrationDate> ) {
public constructor( dateProperty: EnumerationProperty<ConcentrationDate>, panelWidth: number ) {

const textOptions = {
font: GreenhouseEffectConstants.CONTENT_FONT,
maxWidth: 200
maxWidth: panelWidth - 2 * PANEL_MARGINS
};

// Set up the data and text that will be used for the concentration display. Note that H2O is handled as a special
Expand Down

0 comments on commit df92fc6

Please sign in to comment.