From 55f294cb9fbb07bd9c3ef61eddef6ace2df776fb Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Thu, 4 Mar 2021 18:52:57 -0700 Subject: [PATCH] pass equationsVisibleProperty directly to equationNode, #148 --- js/common/view/AxisOfSymmetryNode.js | 4 +--- js/focusanddirectrix/view/DirectrixNode.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/js/common/view/AxisOfSymmetryNode.js b/js/common/view/AxisOfSymmetryNode.js index ae91fd4b..5ae15ddb 100644 --- a/js/common/view/AxisOfSymmetryNode.js +++ b/js/common/view/AxisOfSymmetryNode.js @@ -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 ); @@ -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' ); } } diff --git a/js/focusanddirectrix/view/DirectrixNode.js b/js/focusanddirectrix/view/DirectrixNode.js index 156414d8..7fcde823 100644 --- a/js/focusanddirectrix/view/DirectrixNode.js +++ b/js/focusanddirectrix/view/DirectrixNode.js @@ -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 ); @@ -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' ); } }