From fa0e93e8ac21790ad7b4d550c14d43ec659d069c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Mon, 10 Dec 2018 16:51:16 +0100 Subject: [PATCH] [python/turtle] Fix Turtle::circle for negative angles --- python/port/mod/turtle/turtle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/port/mod/turtle/turtle.cpp b/python/port/mod/turtle/turtle.cpp index 3d80bbb73..1f2ecbc8c 100644 --- a/python/port/mod/turtle/turtle.cpp +++ b/python/port/mod/turtle/turtle.cpp @@ -55,7 +55,7 @@ void Turtle::left(mp_float_t angle) { void Turtle::circle(mp_int_t radius, mp_float_t angle) { mp_float_t oldHeading = heading(); - mp_float_t length = (angle*k_headingScale)*radius; + mp_float_t length = ((angle > 0 ? 1 : -1) * angle * k_headingScale) * radius; if (length > 1) { int i = 1; while(i <= length) {