Skip to content

Commit

Permalink
Moved required parameters to options, see #64
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 14, 2018
1 parent e1d32d6 commit bd93616
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
4 changes: 3 additions & 1 deletion js/friction/view/FrictionScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ define( function( require ) {
this.addChild( this.draggableBook );

// add magnifier
this.magnifierNode = new MagnifierNode( model, 40, 25, 195, 425, chemistryString, {
this.magnifierNode = new MagnifierNode( model, 195, 425, chemistryString, {
x: 40,
y: 25,
layerSplit: true,
tandem: tandem.createTandem( 'magnifierNode' )
} );
Expand Down
17 changes: 4 additions & 13 deletions js/friction/view/magnifier/MagnifierNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,13 @@ define( function( require ) {

/**
* @param {FrictionModel} model
* @param {number} x
* @param {number} y
* @param {number} targetX // TODO: document this and below
* @param {number} targetY
* @param {string} title - the title of the book that is draggable, used for a11y
* @param {number} targetX - x position of the MagnifierTargetNode rectangle
* @param {number} targetY - y position of the MagnifierTargetNode rectangle
* @param {string} title - the title of the book that is draggable, used for a11y
* @param {Object} [options]
* @constructor
*/
function MagnifierNode( model, x, y, targetX, targetY, title, options ) {

// TODO: move x,y into options
options = _.extend( {
x: x,
y: y
}, options );

function MagnifierNode( model, targetX, targetY, title, options ) {
Node.call( this, options );

// main params
Expand Down

0 comments on commit bd93616

Please sign in to comment.