mirror of
https://github.com/SFML/SFML.git
synced 2024-11-29 06:41:05 +08:00
Changed Transformable::setRotation so that the angle is always in [0 .. 360]
This commit is contained in:
parent
e85bd1baf6
commit
3180f83160
@ -71,7 +71,10 @@ void Transformable::setPosition(const Vector2f& position)
|
||||
////////////////////////////////////////////////////////////
|
||||
void Transformable::setRotation(float angle)
|
||||
{
|
||||
m_rotation = angle;
|
||||
m_rotation = static_cast<float>(fmod(angle, 360));
|
||||
if (m_rotation < 0)
|
||||
m_rotation += 360.f;
|
||||
|
||||
m_transformNeedUpdate = true;
|
||||
m_inverseTransformNeedUpdate = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user