Skip to content

Commit

Permalink
fix maxWidth of guess equation for 'Graph The Line' challenges, #117
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Feb 5, 2019
1 parent e5cc1f0 commit 26689cc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/linegame/view/GraphTheLineNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ define( function( require ) {
// @private 'Not A Line', for situations where 3-points do not define a line
this.notALineNode = new Text( notALineString, { font: new GLFont( { size: 24, weight: 'bold' } ), fill: 'black' } );

// See https://github.com/phetsims/graphing-lines/issues/117
// Either the equation or 'not a line' is displayed. So clear guessEquationNode's default maxWidth,
// which is appropriate for an equation on the graph, but not for an equation in EquationBoxNode.
var equationNode = new Node( { children: [ guessEquationNode, this.notALineNode ] } );
guessEquationNode.maxWidth = null;

// Guess
this.guessBoxNode = new EquationBoxNode( yourLineString, LineGameConstants.GUESS_COLOR, boxSize,
new Node( { children: [ guessEquationNode, this.notALineNode ] } ) );
this.guessBoxNode = new EquationBoxNode( yourLineString, LineGameConstants.GUESS_COLOR, boxSize, equationNode );

// @private Graph
this.graphNode = this.createGraphNode( challenge );
Expand Down

0 comments on commit 26689cc

Please sign in to comment.