Closed pixelzoom closed 1 year ago
I fixed this by moving the inputEnabledProperty from OriginalGraphNode to its chartRectangle child. This is the correct place for the inputEnabledProperty, because the DragListener is added to chartRectangle. Here's the derivation in OriginalGraphNode.ts:
// This allows PhET-iO clients to use originalCurveNode.inputEnabledProperty to enabled/disable interactivity,
// and prevents manipulation of the curves when they are hidden using the eyeToggleButton.
// See https://github.com/phetsims/calculus-grapher/issues/240 and https://github.com/phetsims/calculus-grapher/issues/272.
// Do not instrument.
this.chartRectangle.setInputEnabledProperty( new DerivedProperty(
[ originalCurveNode.inputEnabledProperty, predictEnabledProperty, this.curveLayerVisibleProperty ],
( originalCurveNodeInputEnabled, predictEnabled, curveLayerVisible ) =>
( originalCurveNodeInputEnabled || predictEnabled ) && curveLayerVisible
) );
Nothing needed to be changed for cueing arrows in TransformedCurveNode.ts. And there's no PhET-iO API change; originalCurveNode.inputEnabledProperty
is still what the PhET-iO client uses to disable f(x) manipulation.
@veillette please have a look, to see if I messed anything up. Close if it looks OK.
I tested it in studio and it works as intended. Closing.
@amanda-phet @kathy-phet @veillette FYI.
Related to these 2 issues:
We have a problem with
originalCurveNode.inputEnabledProperty
. It doesn't just disable manipulation of f(x). It also disablesoriginalGraphNode.eyeToggleButton
. To reproduce:calculusGrapher.derivativeScreen.view.graphsNode.originalGraphNode.originalCurveNode.inputEnabledProperty
to false.eyeToggleButton
.In order to make the Studio tree look a certain way, this has all gotten way too complicated and clever. All of this needs to be rethought and revised. This will also impact how visiblity of cueing arrows is controlled when f(x) manipulation is disabled.
The technical details...
Most of the problem is in OriginalGraphNode. The DragListener that manipulates the curve is (correctly) added to child
this.chartRectangle
. But we're usingthis.inputEnabledProperty
to disable input input to the entire OriginalGraphNode, not justthis.chartRectangle
. And eyeToggleButton is also a child of OriginalGraphNode, so its input also gets disabled.Relevant code in OriginalGraphNode.ts:
Relevant code in TransformedCurveNode.ts that uses
this.inputEnabledProperty
, and will need to be changed for visibility of the cueing arrows: