diff --git a/js/common/view/GQManipulator.ts b/js/common/view/GQManipulator.ts index a9ab2cc6..b67b10c0 100644 --- a/js/common/view/GQManipulator.ts +++ b/js/common/view/GQManipulator.ts @@ -14,6 +14,7 @@ import PickRequired from '../../../../phet-core/js/types/PickRequired.js'; import { Node, TColor } from '../../../../scenery/js/imports.js'; import graphingQuadratics from '../../graphingQuadratics.js'; import CoordinatesNode from './CoordinatesNode.js'; +import Multilink from '../../../../axon/js/Multilink.js'; // Positions the coordinates relative to the sphere type LayoutCoordinatesFunction = ( coordinates: Vector2 | null, coordinatesNode: Node, radius: number ) => void; @@ -50,6 +51,7 @@ export default class GQManipulator extends Manipulator { const options = optionize()( { // SelfOptions + isDisposable: false, radius: 10, color: 'black', coordinatesBackgroundColor: 'black', @@ -80,8 +82,8 @@ export default class GQManipulator extends Manipulator { this.addChild( coordinatesNode ); // Update layout - coordinatesNode.boundsProperty.link( () => - options.layoutCoordinates( coordinatesProperty.value, coordinatesNode, actualRadius ) ); + Multilink.multilink( [ coordinatesProperty, coordinatesNode.boundsProperty ], + ( coordinates, bounds ) => options.layoutCoordinates( coordinates, coordinatesNode, actualRadius ) ); } } diff --git a/js/standardform/view/PointNode.ts b/js/standardform/view/PointNode.ts index 53a3f5d4..d969216f 100644 --- a/js/standardform/view/PointNode.ts +++ b/js/standardform/view/PointNode.ts @@ -14,6 +14,7 @@ import PickRequired from '../../../../phet-core/js/types/PickRequired.js'; import { Circle, Node, NodeOptions, NodeTranslationOptions, TColor } from '../../../../scenery/js/imports.js'; import CoordinatesNode from '../../common/view/CoordinatesNode.js'; import graphingQuadratics from '../../graphingQuadratics.js'; +import Multilink from '../../../../axon/js/Multilink.js'; // Positions the coordinates relative to the point type LayoutCoordinatesFunction = ( coordinatesNode: Node, pointNode: Node ) => void; @@ -83,7 +84,8 @@ export default class PointNode extends Node { super( options ); // Update layout - coordinatesNode.boundsProperty.link( () => options.layoutCoordinates( coordinatesNode, pointNode ) ); + Multilink.multilink( [ coordinatesProperty, coordinatesNode.boundsProperty ], + ( coordinates, bounds ) => options.layoutCoordinates( coordinatesNode, pointNode ) ); } }