This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: turtle.shapetransform doesn't transform the turtle on the first call
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: Lita.Cho, jesstess, python-dev, rhettinger
Priority: normal Keywords: patch

Created on 2014-06-20 06:14 by Lita.Cho, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
turtle_shapetransform.patch Lita.Cho, 2014-06-20 22:54 review
Messages (5)
msg221068 - (view) Author: Lita Cho (Lita.Cho) * Date: 2014-06-20 06:14
When you call turtle.shapetransform with a transformation matrix, nothing happens. You have to call turtle.shapesize or turtle.shearfactor first before turtle.shapetransform will take affect. Here is an example.

turtle.shapetransform(2,0,0,2) 
turtle.shapesize(1) 
turtle.shapetransform(2,0,0,2)

Nothing happens with the first call of shapetransform, but after calling shapesize, shapetransform then doubles in size, like it should.
msg221130 - (view) Author: Lita Cho (Lita.Cho) * Date: 2014-06-20 22:54
Have a patch that fixes this. Rather than calling self._update() directory, we should be calling self._pen(resizemode="user"), since the user is changing the size of the turtle, just like how shapesize and shearfactor are updating.
msg221231 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-06-22 08:24
New changeset 39b094798e14 by Raymond Hettinger in branch '3.4':
Issue #21812:  Trigger immediate transformation in turtle.shapetransform().
http://hg.python.org/cpython/rev/39b094798e14
msg221233 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-06-22 08:29
Thanks for noticing this and for the patch.

In the future, to make patches easier to review, please isolate the core logic change from inconsequential whitespace and linewrap edits.  Also note that breaking strings in the middle to accommodate a max line length can be error-prone (in this case a space was dropped between "matrix:" and "must").
msg221322 - (view) Author: Lita Cho (Lita.Cho) * Date: 2014-06-22 22:47
Absolutely! I totally forgot I made those changes for PEP8! Next time, I will totally submit just the change associated with the ticket.

Thank you, Raymond, for the feedback and reviewing my code!
History
Date User Action Args
2022-04-11 14:58:05adminsetgithub: 66011
2014-06-22 22:47:00Lita.Chosetmessages: + msg221322
2014-06-22 08:29:08rhettingersetstatus: open -> closed
versions: + Python 3.4, Python 3.5
type: behavior
messages: + msg221233

resolution: fixed
stage: resolved
2014-06-22 08:24:03python-devsetnosy: + python-dev
messages: + msg221231
2014-06-22 08:05:30rhettingersetmessages: - msg221228
2014-06-22 07:54:43rhettingersetassignee: rhettinger

messages: + msg221228
nosy: + rhettinger
2014-06-20 22:54:54Lita.Chosetfiles: + turtle_shapetransform.patch
keywords: + patch
messages: + msg221130
2014-06-20 06:14:50Lita.Chosetnosy: + jesstess
2014-06-20 06:14:39Lita.Chocreate