Skip to content

Commit

Permalink
Fixed shape and color for test rectangles, see #251
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Nov 7, 2014
1 parent 408ae26 commit 497227b
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions js/flow/view/PipeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,22 @@ define( function( require ) {
myParticleLayer.addChild( rectangle );
}

this.flowModel.on( 'step', function() {
for ( var i = 0; i < flowModel.flowParticles.length; i++ ) {
var particle = flowModel.flowParticles.get( i );
var x = pipeNode.modelViewTransform.modelToViewX( particle.xPosition );
var y = pipeNode.modelViewTransform.modelToViewY( particle.getY() );
if ( i < rectangles.length - 1 ) {
rectangle = rectangles[i];
rectangle.centerX = x;
rectangle.centerY = y;
}
}
// if ( flowModel.flowParticles.length > 0 ) {
// var particle = flowModel.flowParticles.get( 0 );
//
// this.flowModel.on( 'step', function() {
// for ( var i = 0; i < flowModel.flowParticles.length; i++ ) {
// var particle = flowModel.flowParticles.get( i );
// var x = pipeNode.modelViewTransform.modelToViewX( particle.xPosition );
// var y = pipeNode.modelViewTransform.modelToViewY( particle.getY() );
// if ( i < rectangles.length - 1 ) {
// rectangle = rectangles[i];
// rectangle.centerX = x;
// rectangle.centerY = y;
// }
// }
} );
//// if ( flowModel.flowParticles.length > 0 ) {
//// var particle = flowModel.flowParticles.get( 0 );
////
//// }
// } );

this.addChild( myParticleLayer );
this.addChild( this.pipeFlowLine );
Expand Down

0 comments on commit 497227b

Please sign in to comment.