Skip to content

Commit

Permalink
document why domainProperty.link is the responsibility of WavePacketN…
Browse files Browse the repository at this point in the history
…umberControl, #165
  • Loading branch information
pixelzoom committed Sep 20, 2021
1 parent 8903668 commit 4b98e0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/wavepacket/view/WavePacketNumberControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
}
Expand Down

0 comments on commit 4b98e0f

Please sign in to comment.