From 4b98e0f6c2b36eb67a6377ff56ad7c5b6d6807ab Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Mon, 20 Sep 2021 16:56:54 -0600 Subject: [PATCH] document why domainProperty.link is the responsibility of WavePacketNumberControl, https://github.com/phetsims/fourier-making-waves/issues/165 --- js/wavepacket/view/WavePacketNumberControl.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/wavepacket/view/WavePacketNumberControl.js b/js/wavepacket/view/WavePacketNumberControl.js index 7cb1bc39..938b1dfd 100644 --- a/js/wavepacket/view/WavePacketNumberControl.js +++ b/js/wavepacket/view/WavePacketNumberControl.js @@ -64,8 +64,9 @@ class WavePacketNumberControl extends NumberControl { [ this.slider.thumbDragListener.isPressedProperty, this.slider.trackDragListener.isPressedProperty ], ( thumbIsPressed, trackIsPressed ) => ( thumbIsPressed || trackIsPressed ) ); - // Update the displayed value. - //REVIEW: I don't see other dependence on this directly, I presume subtypes do? + // Subclasses generally provide options.numberDisplayOptions.numberFormatter which tailors the value display to + // the domain. So when the domain changes, this will cause NumberControl tell its NumberDisplay to call + // that numberFormatter. domainProperty.link( () => this.redrawNumberDisplay() ); } }