mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Bug #1514693: Update turtle's heading when switching between
degrees and radians.
This commit is contained in:
parent
4c4300de4e
commit
2b88f63a3c
2 changed files with 10 additions and 2 deletions
|
@ -30,6 +30,7 @@ class RawPen:
|
||||||
self._tracing = 1
|
self._tracing = 1
|
||||||
self._arrow = 0
|
self._arrow = 0
|
||||||
self._delay = 10 # default delay for drawing
|
self._delay = 10 # default delay for drawing
|
||||||
|
self._angle = 0.0
|
||||||
self.degrees()
|
self.degrees()
|
||||||
self.reset()
|
self.reset()
|
||||||
|
|
||||||
|
@ -39,6 +40,10 @@ class RawPen:
|
||||||
Example:
|
Example:
|
||||||
>>> turtle.degrees()
|
>>> turtle.degrees()
|
||||||
"""
|
"""
|
||||||
|
# Don't try to change _angle if it is 0, because
|
||||||
|
# _fullcircle might not be set, yet
|
||||||
|
if self._angle:
|
||||||
|
self._angle = (self._angle / self._fullcircle) * fullcircle
|
||||||
self._fullcircle = fullcircle
|
self._fullcircle = fullcircle
|
||||||
self._invradian = pi / (fullcircle * 0.5)
|
self._invradian = pi / (fullcircle * 0.5)
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,11 @@ Core and builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Bug #1514693: Update turtle's heading when switching between
|
||||||
|
degrees and radians.
|
||||||
|
|
||||||
- Reimplement turtle.circle using a polyline, to allow correct
|
- Reimplement turtle.circle using a polyline, to allow correct
|
||||||
filling of arcs. Also fixes #1514693.
|
filling of arcs.
|
||||||
|
|
||||||
- Bug #1514703: Only setup canvas window in turtle when the canvas
|
- Bug #1514703: Only setup canvas window in turtle when the canvas
|
||||||
is created.
|
is created.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue