From 3ed870d71c55a07446861a31062b268c708728d0 Mon Sep 17 00:00:00 2001 From: Sam Reid Date: Sat, 10 Jun 2023 06:38:25 -0600 Subject: [PATCH] Move physical range to the call site, see https://github.com/phetsims/center-and-variability/issues/222 --- js/common/view/CAVScreenView.ts | 3 ++- js/soccer-common/view/SceneView.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js/common/view/CAVScreenView.ts b/js/common/view/CAVScreenView.ts index 9164634a..3faac979 100644 --- a/js/common/view/CAVScreenView.ts +++ b/js/common/view/CAVScreenView.ts @@ -126,7 +126,8 @@ export default class CAVScreenView extends ScreenView { model, sceneModel, ( soccerPlayer, sceneModel ) => this.getSoccerPlayerImageSet( soccerPlayer, sceneModel ), - modelViewTransform, { + modelViewTransform, + CAVConstants.PHYSICAL_RANGE, { tandem: options.tandem.createTandem( `${CAVConstants.SCENE_VIEW_TANDEM}${index + 1}` ) } ) ); diff --git a/js/soccer-common/view/SceneView.ts b/js/soccer-common/view/SceneView.ts index cd261c46..21c79404 100644 --- a/js/soccer-common/view/SceneView.ts +++ b/js/soccer-common/view/SceneView.ts @@ -21,8 +21,8 @@ import { Shape } from '../../../../kite/js/imports.js'; import Bounds2 from '../../../../dot/js/Bounds2.js'; import SoccerPlayer from '../model/SoccerPlayer.js'; import MedianHighlightLayer from '../../common/view/MedianHighlightLayer.js'; -import CAVConstants from '../../common/CAVConstants.js'; import Property from '../../../../axon/js/Property.js'; +import Range from '../../../../dot/js/Range.js'; /** * Renders view elements for a CAVSceneModel. Note that to satisfy the correct z-ordering, elements @@ -38,6 +38,7 @@ export default class SceneView { public readonly sceneModel: CAVSceneModel, getSoccerPlayerImageSet: ( soccerPlayer: SoccerPlayer, sceneModel: CAVSceneModel ) => SoccerPlayerImageSet, modelViewTransform: ModelViewTransform2, + physicalRange: Range, options: { tandem: Tandem } ) { const soccerBallMap = new Map(); @@ -62,7 +63,7 @@ export default class SceneView { model.objectNodesInputEnabledProperty, { tandem: options.tandem.createTandem( 'soccerBallNodes' ).createTandem( `soccerBallNode${index + 1}` ), pickable: false, - enabledRangeProperty: new Property( CAVConstants.PHYSICAL_RANGE ) + enabledRangeProperty: new Property( physicalRange ) } ); backLayerSoccerBallLayer.addChild( soccerBallNode );