code-dot-org/code-dot-org — pull request #2 by cpirich (2014-09-22 17:50:03+00:00)
Title: store sprite.value again, use it properly in setSpriteSize

A recent change broke setSpriteSize. setSprite used to store the value in sprite.value. That was useful so setSpriteSize() could call back into setSprite() with the same value as was previously set.

I restored the code that stores sprite.value.

And I added a conditional check in setSpriteSize() to avoid calling setSprite() when the sprite is hidden. The command will still work (so you can change the size before you set the image), but there is no need to execute all of the code in setSprite() unless the sprite is visible.

TODO: add a test case for setSpriteSize() so this doesn't happen again in the future :)