Skip to content

Commit

Permalink
energy visible if non-negative, see #52
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Jan 16, 2019
1 parent 2369599 commit 217c5b7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions js/energy-skate-park/view/PieChartWebGLNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ define( function( require ) {
// don't easily represent negative values
skater.potentialEnergyProperty.link( function( potentialEnergy ) {

var energyPositive = potentialEnergy > 0;
var energyNonnegative = potentialEnergy >= 0;

outline.visible = energyPositive;
potentialEnergyPiece.visible = energyPositive;
kineticEnergyPiece.visible = energyPositive;
thermalEnergyPiece.visible = energyPositive;
outline.visible = energyNonnegative;
potentialEnergyPiece.visible = energyNonnegative;
kineticEnergyPiece.visible = energyNonnegative;
thermalEnergyPiece.visible = energyNonnegative;

circularOutline.visible = !energyPositive;
totalEnergyPiece.visible = !energyPositive;
circularOutline.visible = !energyNonnegative;
totalEnergyPiece.visible = !energyNonnegative;

} );
}
Expand Down

0 comments on commit 217c5b7

Please sign in to comment.