SFML community forums

Help => Graphics => Topic started by: Jove on July 15, 2012, 02:26:05 pm

Title: Sprite getRotation returning negative (2RC)
Post by: Jove on July 15, 2012, 02:26:05 pm
I looked around first, search wasn't working for me and didn't see anything on the tracker.

When I do a getRotation from a sprite, the result isn't between 0-360.

This...
sf::Sprite test;
test.rotate(-10);
cout << test.getRotation();

...will return a -10 instead of 350.

Getting a View's rotation is ok though.

Apologies if I've missed something, 1.6 had the documented behaviour.
Title: Re: Sprite getRotation returning negative (2RC)
Post by: eXpl0it3r on July 15, 2012, 02:44:47 pm
I can confirm this bug. :-\

The doc  (http://www.sfml-dev.org/documentation/2.0/classsf_1_1Transformable.php#ad783a7e9971398ec613d22455252809e)says:
Quote
float sf::Transformable::getRotation() const
get the orientation of the object

The rotation is always in the range [0, 360].

Returns:
Current rotation, in degrees

Since I haven't found an issue on the track, I guess you could create a new issue there.
Title: Re: Sprite getRotation returning negative (2RC)
Post by: Laurent on July 15, 2012, 02:53:43 pm
Thanks, it's fixed.