phetsims / color-vision

"Color Vision" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/color-vision
GNU General Public License v3.0
1 stars 7 forks source link

Undefined left positioning in FlashLightNode #33

Closed samreid closed 10 years ago

samreid commented 10 years ago

I saw this code in FlashLightNode:

    var flashlightImage = new Image( flashlight,
      {
        scale: scale,
        left: this.centerX,
        centerY: this.centerY
      } );

But the this.centerX is always undefined. Should it be removed?

aaronsamuel137 commented 10 years ago

Yes, this should be removed. Same with centerY. The beam is positioned relative to the flashlight, so no need to worry about positioning the flashlight image itself.

aaronsamuel137 commented 10 years ago

Removed left and centerY options. The node still looks the same. Assigning to @samreid for review.

samreid commented 10 years ago

Looks great, thanks! Closing.