diff --git a/js/accessibility/pdom/ParallelDOM.ts b/js/accessibility/pdom/ParallelDOM.ts index 2d81c0c0f..a1c9841b1 100644 --- a/js/accessibility/pdom/ParallelDOM.ts +++ b/js/accessibility/pdom/ParallelDOM.ts @@ -141,6 +141,7 @@ import ReadOnlyProperty from '../../../../axon/js/ReadOnlyProperty.js'; import TinyProperty from '../../../../axon/js/TinyProperty.js'; import TinyForwardingProperty from '../../../../axon/js/TinyForwardingProperty.js'; import TProperty from '../../../../axon/js/TProperty.js'; +import isSettingPhetioStateProperty from '../../../../tandem/js/isSettingPhetioStateProperty.js'; const INPUT_TAG = PDOMUtils.TAGS.INPUT; const P_TAG = PDOMUtils.TAGS.P; @@ -2629,8 +2630,7 @@ export default class ParallelDOM extends PhetioObject { public alertDescriptionUtterance( utterance: TAlertable ): void { // No description should be alerted if setting PhET-iO state, see https://github.com/phetsims/scenery/issues/1397 - if ( _.hasIn( window, 'phet.phetio.phetioEngine.phetioStateEngine' ) && - phet.phetio.phetioEngine.phetioStateEngine.isSettingStateProperty.value ) { + if ( isSettingPhetioStateProperty.value ) { return; } diff --git a/js/listeners/AnimatedPanZoomListener.js b/js/listeners/AnimatedPanZoomListener.js index ad578f4e6..f97aba96a 100644 --- a/js/listeners/AnimatedPanZoomListener.js +++ b/js/listeners/AnimatedPanZoomListener.js @@ -15,6 +15,7 @@ import Vector2 from '../../../dot/js/Vector2.js'; import merge from '../../../phet-core/js/merge.js'; import platform from '../../../phet-core/js/platform.js'; import EventType from '../../../tandem/js/EventType.js'; +import isSettingPhetioStateProperty from '../../../tandem/js/isSettingPhetioStateProperty.js'; import PhetioAction from '../../../tandem/js/PhetioAction.js'; import Tandem from '../../../tandem/js/Tandem.js'; import { EventIO, FocusManager, globalKeyStateTracker, Intent, KeyboardDragListener, KeyboardUtils, KeyboardZoomUtils, Node, PanZoomListener, PDOMPointer, PDOMUtils, PressListener, scenery } from '../imports.js'; @@ -177,9 +178,8 @@ class AnimatedPanZoomListener extends PanZoomListener { // set source and destination positions and scales after setting from state // to initialize values for animation with AnimatedPanZoomListener this.sourceFramePanBoundsProperty.lazyLink( () => { - const simGlobal = _.get( window, 'phet.joist.sim', null ); // returns null if global isn't found - if ( ( simGlobal && simGlobal.isSettingPhetioStateProperty.value ) ) { + if ( isSettingPhetioStateProperty.value ) { this.initializePositions(); this.sourceScale = this.getCurrentScale(); this.setDestinationScale( this.sourceScale ); diff --git a/js/listeners/PanZoomListener.js b/js/listeners/PanZoomListener.js index 76af834cd..d9437c65a 100644 --- a/js/listeners/PanZoomListener.js +++ b/js/listeners/PanZoomListener.js @@ -13,6 +13,7 @@ import Bounds2 from '../../../dot/js/Bounds2.js'; import Matrix3 from '../../../dot/js/Matrix3.js'; import merge from '../../../phet-core/js/merge.js'; import ModelViewTransform2 from '../../../phetcommon/js/view/ModelViewTransform2.js'; +import isSettingPhetioStateProperty from '../../../tandem/js/isSettingPhetioStateProperty.js'; import Tandem from '../../../tandem/js/Tandem.js'; import { MultiListener, scenery } from '../imports.js'; @@ -76,9 +77,7 @@ class PanZoomListener extends MultiListener { } ); this.sourceFramePanBoundsProperty.lazyLink( () => { - const simGlobal = _.get( window, 'phet.joist.sim', null ); // returns null if global isn't found - - if ( ( simGlobal && simGlobal.isSettingPhetioStateProperty.value ) ) { + if ( isSettingPhetioStateProperty.value ) { // The matrixProperty has transformations relative to the global view coordinates of the source simulation, // so it will not be correct if source and destination frames are different sizes. This will map transforamtions