[python/turtle] Clean Turtle::PawPosition

This commit is contained in:
Léa Saviot
2018-12-12 15:33:28 +01:00
parent 8ac60983ed
commit 91c4fea517
2 changed files with 7 additions and 7 deletions

View File

@@ -330,7 +330,7 @@ void Turtle::drawPaw(PawType type, PawPosition pos) {
// Compute the paw offset from the turtle center
float currentAngle = angles[(int) type];
float crawlDelta = (((int)pos) - 2.0f) * crawlOffset;
float crawlDelta = ((float)((int)pos)) * crawlOffset;
float pawX = pawOffset * sin(m_heading+currentAngle) + crawlDelta * sin(m_heading);
float pawY = - pawOffset * cos(m_heading+currentAngle) - crawlDelta * cos(m_heading);
KDCoordinate pawOffsetX = ((int)pawX) - (pawX < 0 ? 1 : 0);

View File

@@ -91,12 +91,12 @@ private:
BackLeft = 3
};
enum class PawPosition : int {
Backwards = 0,
HalfBackwards = 1,
Normal = 2,
HalfForward = 3,
Forward = 4
enum class PawPosition : int8_t {
Backwards = -1,
HalfBackwards = -2,
Normal = 0,
HalfForward = 1,
Forward = 2
};
class NameColorPair {