Skip to content

Commit

Permalink
Addressed REVIEW: Corrections after refactoring model.options.basicsV…
Browse files Browse the repository at this point in the history
…ersion. Also corrected shelves not appearing on desired screens. #48
  • Loading branch information
Denz1994 committed Jan 30, 2019
1 parent 9c3da7a commit 1afb03a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/bounce/BounceScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ define( require => {
constructor( tandem, options ) {

options = _.extend( {
basicsVersion: true,
name: screenBounceString,
backgroundColorProperty: MassesAndSpringsColorProfile.backgroundProperty,
homeScreenIcon: new Image( bounceHomeScreenImage ),
Expand All @@ -45,6 +44,7 @@ define( require => {

// model reference used for spring and mass creation
const model = new MassesAndSpringsModel( modelTandem, options );
model.basicsVersion = true;
model.addDefaultSprings( modelTandem );
model.addDefaultMasses( modelTandem );
return model;
Expand Down
9 changes: 8 additions & 1 deletion js/bounce/view/BounceScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,15 @@ define( require => {
rectY: this.modelViewTransform.modelToViewY( MassesAndSpringsConstants.FLOOR_Y ) - this.shelf.rectHeight
} );

const mysteryMassesShelf = new ShelfNode( tandem, {
rectHeight: 7,
rectWidth: 120,
left: labeledMassesShelf.right + this.spacing * 2,
rectY: this.modelViewTransform.modelToViewY( MassesAndSpringsConstants.FLOOR_Y ) - this.shelf.rectHeight
} );

// Back layer used to handle z order of view elements.
this.backLayer.children = [ this.backgroundDragPlane, rightPanelsVBox, labeledMassesShelf ];
this.backLayer.children = [ this.backgroundDragPlane, rightPanelsVBox, labeledMassesShelf, mysteryMassesShelf ];
}
}

Expand Down
2 changes: 1 addition & 1 deletion js/lab/LabScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ define( require => {
}, options );

super(
() => new LabModel( tandem.createTandem( 'model' ), options ),
() => new LabModel( tandem.createTandem( 'model' ), true, options ),
model => { return new LabScreenView( model, tandem.createTandem( 'view' ) ); },
options
);
Expand Down
1 change: 0 additions & 1 deletion js/lab/view/LabScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ define( require => {

// Calls common spring view
super( model, tandem );

const vectorVisibilityControlNode = new VectorVisibilityControlNode(
model,
tandem.createTandem( 'vectorVisibilityControlNode' ),
Expand Down
1 change: 0 additions & 1 deletion js/stretch/StretchScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ define( require => {
constructor( tandem, options ) {

options = _.extend( {
basicsVersion: true,
name: screenStretchString,
backgroundColorProperty: MassesAndSpringsColorProfile.backgroundProperty,
homeScreenIcon: new Image( stretchHomeScreenImage ),
Expand Down
9 changes: 8 additions & 1 deletion js/stretch/view/StretchScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ define( require => {
rectY: this.modelViewTransform.modelToViewY( MassesAndSpringsConstants.FLOOR_Y ) - this.shelf.rectHeight
} );

const mysteryMassesShelf = new ShelfNode( tandem, {
rectHeight: 7,
rectWidth: 120,
left: labeledMassesShelf.right + this.spacing * 2,
rectY: this.modelViewTransform.modelToViewY( MassesAndSpringsConstants.FLOOR_Y ) - this.shelf.rectHeight
} );

// @public {DraggableRulerNode}
this.rulerNode = new DraggableRulerNode(
this.modelViewTransform,
Expand All @@ -109,7 +116,7 @@ define( require => {
this.addChild( this.rulerNode );

// Back layer used to handle z order of view elements.
this.backLayer.children = [ this.backgroundDragPlane, optionsPanel, labeledMassesShelf ];
this.backLayer.children = [ this.backgroundDragPlane, optionsPanel, labeledMassesShelf, mysteryMassesShelf ];

this.visibleBoundsProperty.link( () => {
optionsPanel.rightTop = new Vector2( this.panelRightSpacing, this.springSystemControlsNode.top );
Expand Down

0 comments on commit 1afb03a

Please sign in to comment.