Skip to content

Commit

Permalink
move isSettingPhetioStateProperty to tandem/, phetsims/tandem#294
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Kauzmann <[email protected]>
  • Loading branch information
zepumph committed May 31, 2023
1 parent a08b087 commit 39e4e1b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions js/accessibility/pdom/ParallelDOM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions js/listeners/AnimatedPanZoomListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 );
Expand Down
5 changes: 2 additions & 3 deletions js/listeners/PanZoomListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 39e4e1b

Please sign in to comment.