Skip to content

Commit

Permalink
phet-io for rulers, #263
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Dec 7, 2021
1 parent b60d4bf commit 5287c7c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/common/view/GeometricOpticsScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class GeometricOpticsScreenView extends ScreenView {
// create Rulers
const horizontalRulerNode = new GeometricOpticsRulerNode( model.horizontalRuler,
zoomTransformProperty, zoomScaleProperty, this.visibleBoundsProperty, {
tandem: config.tandem.createTandem( 'horizontalRulerNode' )
tandem: config.tandem.createTandem( 'horizontalRulerNode' )
} );
const verticalRulerNode = new GeometricOpticsRulerNode( model.verticalRuler,
zoomTransformProperty, zoomScaleProperty, this.visibleBoundsProperty, {
Expand All @@ -151,8 +151,11 @@ class GeometricOpticsScreenView extends ScreenView {
} );

// Tell the rulers where the toolbox is.
horizontalRulerNode.setToolboxBounds( rulersToolbox.bounds );
verticalRulerNode.setToolboxBounds( rulersToolbox.bounds );
rulersToolbox.visibleProperty.link( visible => {
const bounds = visible ? rulersToolbox.bounds : Bounds2.NOTHING;
horizontalRulerNode.setToolboxBounds( bounds );
verticalRulerNode.setToolboxBounds( bounds );
} );

// radio buttons for the shape of the optic
const opticShapeRadioButtonGroup = new OpticShapeRadioButtonGroup( model.optic, {
Expand Down

0 comments on commit 5287c7c

Please sign in to comment.