Skip to content

Commit

Permalink
Move flat mirror to same screen coordinates as lens, phetsims/geomet…
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Feb 22, 2022
1 parent ab13550 commit b2df943
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions js/mirror/MirrorScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class MirrorScreen extends Screen<MirrorModel, MirrorScreenView> {
tandem: options.tandem.createTandem( 'model' )
} ),
model => new MirrorScreenView( model, {
isBasicsVersion: isBasicsVersion,
tandem: options.tandem.createTandem( 'view' )
} ),
options
Expand Down
5 changes: 4 additions & 1 deletion js/mirror/view/MirrorScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import BooleanProperty from '../../../../axon/js/BooleanProperty.js';
import Optic from '../../common/model/Optic.js';

type MirrorScreenViewOptions = {
isBasicsVersion: boolean,
tandem: Tandem
};

Expand All @@ -34,7 +35,9 @@ class MirrorScreenView extends GOScreenView {
const options = merge( {

// View origin is to right, and a little above center.
getViewOrigin: ( layoutBounds: Bounds2 ) => new Vector2( layoutBounds.centerX + 200, layoutBounds.centerY - 35 ),
getViewOrigin: providedOptions.isBasicsVersion ?
( layoutBounds: Bounds2 ) => new Vector2( layoutBounds.centerX, layoutBounds.centerY - 35 ) :
( layoutBounds: Bounds2 ) => new Vector2( layoutBounds.centerX + 200, layoutBounds.centerY - 35 ),

// Creates the Node for the mirror
createOpticNode: ( optic: Optic, modelViewTransform: ModelViewTransform2, parentTandem: Tandem ) => {
Expand Down

0 comments on commit b2df943

Please sign in to comment.