Skip to content

Commit

Permalink
Made Vector2 constructor arguments required, see phetsims/dot#85
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 16, 2019
1 parent 496229f commit 2ef5715
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/common/model/Ribosome.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ define( function( require ) {
* @public
*/
getProteinAttachmentPoint: function( newAttachmentPoint ) {
newAttachmentPoint = newAttachmentPoint || new Vector2();
newAttachmentPoint = newAttachmentPoint || new Vector2( 0, 0 );
newAttachmentPoint.x = this.getPosition().x + OFFSET_TO_PROTEIN_OUTPUT_CHANNEL.x;
newAttachmentPoint.y = this.getPosition().y + OFFSET_TO_PROTEIN_OUTPUT_CHANNEL.y;
return newAttachmentPoint;
Expand Down
4 changes: 2 additions & 2 deletions js/common/model/ShapeChangingModelElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ define( function( require ) {
};

// reusable position vectors, used to prevent allocations of new vectors and thus improve performance
this.reusablePositionVector1 = new Vector2();
this.reusablePositionVector2 = new Vector2();
this.reusablePositionVector1 = new Vector2( 0, 0 );
this.reusablePositionVector2 = new Vector2( 0, 0 );
}

geneExpressionEssentials.register( 'ShapeChangingModelElement', ShapeChangingModelElement );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ define( function( require ) {
function RibosomeAttachedState( ribosomeAttachmentStateMachine ) {
AttachmentState.call( this );
this.ribosomeAttachmentStateMachine = ribosomeAttachmentStateMachine; //@public
this.proteinAttachmentPointScratchVector = new Vector2();
this.proteinAttachmentPointScratchVector = new Vector2( 0, 0 );
}

geneExpressionEssentials.register( 'RibosomeAttachedState', RibosomeAttachedState );
Expand Down
4 changes: 2 additions & 2 deletions js/common/view/DnaMoleculeCanvasNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ define( function( require ) {
this.backboneStrokeWidth = modelViewTransform.viewToModelDeltaX( backboneStrokeWidth ); // @private

// @private - pre-allocated reusable vectors, used to reduce garbage collection
this.cp1ResuableVector = new Vector2();
this.cp2ResuableVector = new Vector2();
this.cp1ResuableVector = new Vector2( 0, 0 );
this.cp2ResuableVector = new Vector2( 0, 0 );

// @private - four arrays for the DNA backbone representation
var longerArrayLength = Util.roundSymmetric( this.model.strand1Segments.length / 2 );
Expand Down

0 comments on commit 2ef5715

Please sign in to comment.