mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[python/turtle] Fix speed type
This commit is contained in:
@@ -73,7 +73,7 @@ void Turtle::setHeading(mp_float_t angle) {
|
||||
}
|
||||
|
||||
void Turtle::setSpeed(mp_int_t speed) {
|
||||
if (speed < k_minSpeed || speed > k_maxSpeed) {
|
||||
if (speed < 0 || speed > k_maxSpeed) {
|
||||
m_speed = 0;
|
||||
} else {
|
||||
m_speed = speed;
|
||||
|
||||
@@ -70,9 +70,8 @@ private:
|
||||
static constexpr KDCoordinate k_xOffset = Ion::Display::Width / 2;
|
||||
static constexpr KDCoordinate k_yOffset = (Ion::Display::Height - 18) / 2;
|
||||
static constexpr int k_numberOfIcons = 8;
|
||||
static constexpr float k_minSpeed = 0.5f;
|
||||
static constexpr float k_defaultSpeed = 3.0f;
|
||||
static constexpr float k_maxSpeed = 10.0f;
|
||||
static constexpr uint8_t k_defaultSpeed = 3;
|
||||
static constexpr uint8_t k_maxSpeed = 10;
|
||||
|
||||
KDPoint position(mp_float_t x, mp_float_t y) const;
|
||||
KDPoint position() const { return position(m_x, m_y); }
|
||||
|
||||
Reference in New Issue
Block a user