From 68b0b6239718cd31955f388b7e0aa7eea409e784 Mon Sep 17 00:00:00 2001 From: Julian Murgia Date: Fri, 20 May 2016 23:03:25 +0200 Subject: [PATCH] I forgot the second script Resolved wrapping problem. Was happening because we wrapped angle value at the moment they reach 360. In fact we have to do it only if both angles reach 360 ;) Fixes #151 --- tutorials/2d/custom_drawing_in_2d.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tutorials/2d/custom_drawing_in_2d.rst b/tutorials/2d/custom_drawing_in_2d.rst index a5bcd4d2b..1a470832a 100644 --- a/tutorials/2d/custom_drawing_in_2d.rst +++ b/tutorials/2d/custom_drawing_in_2d.rst @@ -237,8 +237,11 @@ In our case, we simply need to multiply our 'rotation_ang' variable by 'delta' i func _process(delta): angle_from += rotation_ang * delta angle_to += rotation_ang * delta - angle_from = wrap(angle_from, 0, 360) - angle_to = wrap(angle_to, 0, 360) + + # we only wrap angles if both of them are bigger than 360 + if (angle_from > 360 && angle_to > 360): + angle_from = wrap(angle_from, 0, 360) + angle_to = wrap(angle_to, 0, 360) update() Let's run again! This time, the rotation displays fine!