libgdx/libgdx — pull request #2146 by obigu (2014-07-21 21:35:55+00:00)
Title: Reset scale and rotation values on simplified SpriteDrawable draw() call

This fixes an issue that happens when scaling or rotating a SpriteDrawable wrapper (like Image) with a value different from default value (1 for scaling 0 for rotation) and then scaling/rotating it back to default value. The scale and rotation values of the Sprite don't get updated back to the default values.

It happens because the simplified/short draw call(), that doesn't change the scale and rotation of the Sprite, is usually used when the scale of the SpriteDrawable wrapper is 1 and the rotation 0 (see the draw() implementation of the Image class for instance).

To reproduce the issue, create an Image() with a SpriteDrawable, set the scale to 0.5, draw it and then set it back to 1. It will still be drawn as if it was scaled 0.5.

And as a nice side effect we reuse some code :)