Skip to content

Commit

Permalink
pass equationsVisibleProperty directly to equationNode, #148
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Mar 5, 2021
1 parent 32711c3 commit 55f294c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions js/common/view/AxisOfSymmetryNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class AxisOfSymmetryNode extends Node {

// equation text on a translucent background
const equationNode = new GQBackgroundNode( equationText, {
visibleProperty: equationsVisibleProperty,
maxHeight: 100 // maxHeight because equation is rotated, determined empirically
} );
this.addChild( equationNode );
Expand Down Expand Up @@ -108,9 +109,6 @@ class AxisOfSymmetryNode extends Node {
graph.xRange.contains( quadratic.axisOfSymmetry ) // the axis of symmetry (x=N) is on the graph
);
visibleProperty.linkAttribute( this, 'visible' );

// visibility of equation
equationsVisibleProperty.linkAttribute( equationNode, 'visible' );
}
}

Expand Down
4 changes: 1 addition & 3 deletions js/focusanddirectrix/view/DirectrixNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class DirectrixNode extends Node {

// equation text on a translucent background
const equationNode = new GQBackgroundNode( equationText, {
visibleProperty: equationsVisibleProperty,
maxWidth: 100 // determined empirically
} );
this.addChild( equationNode );
Expand Down Expand Up @@ -93,9 +94,6 @@ class DirectrixNode extends Node {
graph.yRange.contains( quadratic.directrix ) // the directrix (y=N) is on the graph
);
visibleProperty.linkAttribute( this, 'visible' );

// visibility of equation
equationsVisibleProperty.linkAttribute( equationNode, 'visible' );
}
}

Expand Down

0 comments on commit 55f294c

Please sign in to comment.