Skip to content

Commit

Permalink
Rulers visibility improvements for #147
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Jun 9, 2020
1 parent 1ad2c09 commit a3e6463
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions js/wave-on-a-string/view/WOASScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,17 @@ class WOASScreenView extends ScreenView {
tandem: verticalRulerTandem
}, rulerOptions ) );
verticalRulerNode.rotate( -Math.PI / 2 );
this.addChild( horizontalRulerNode );
this.addChild( verticalRulerNode );

model.rulersVisibleProperty.link( rulersVisible => {
horizontalRulerNode.visible = rulersVisible;
verticalRulerNode.visible = rulersVisible;
const rulersNode = new Node( {
children: [
horizontalRulerNode,
verticalRulerNode
],
tandem: rulersTandem,
visibleProperty: model.rulersVisibleProperty
} );
this.addChild( rulersNode );

model.horizontalRulerPositionProperty.link( position => {
horizontalRulerNode.translation = position;
} );
Expand Down

0 comments on commit a3e6463

Please sign in to comment.