Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turtle.shapetransform doesn't transform the turtle on the first call #66011

Closed
LitaCho mannequin opened this issue Jun 20, 2014 · 5 comments
Closed

turtle.shapetransform doesn't transform the turtle on the first call #66011

LitaCho mannequin opened this issue Jun 20, 2014 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@LitaCho
Copy link
Mannequin

LitaCho mannequin commented Jun 20, 2014

BPO 21812
Nosy @rhettinger
Files
  • turtle_shapetransform.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/rhettinger'
    closed_at = <Date 2014-06-22.08:29:08.139>
    created_at = <Date 2014-06-20.06:14:39.986>
    labels = ['type-bug', 'library']
    title = "turtle.shapetransform doesn't transform the turtle on the first call"
    updated_at = <Date 2014-06-22.22:47:00.350>
    user = 'https://bugs.python.org/LitaCho'

    bugs.python.org fields:

    activity = <Date 2014-06-22.22:47:00.350>
    actor = 'Lita.Cho'
    assignee = 'rhettinger'
    closed = True
    closed_date = <Date 2014-06-22.08:29:08.139>
    closer = 'rhettinger'
    components = ['Library (Lib)']
    creation = <Date 2014-06-20.06:14:39.986>
    creator = 'Lita.Cho'
    dependencies = []
    files = ['35714']
    hgrepos = []
    issue_num = 21812
    keywords = ['patch']
    message_count = 5.0
    messages = ['221068', '221130', '221231', '221233', '221322']
    nosy_count = 4.0
    nosy_names = ['rhettinger', 'jesstess', 'python-dev', 'Lita.Cho']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue21812'
    versions = ['Python 3.4', 'Python 3.5']

    @LitaCho
    Copy link
    Mannequin Author

    LitaCho mannequin commented Jun 20, 2014

    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.

    @LitaCho LitaCho mannequin added the stdlib Python modules in the Lib dir label Jun 20, 2014
    @LitaCho
    Copy link
    Mannequin Author

    LitaCho mannequin commented Jun 20, 2014

    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.

    @rhettinger rhettinger self-assigned this Jun 22, 2014
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jun 22, 2014

    New changeset 39b094798e14 by Raymond Hettinger in branch '3.4':
    Issue bpo-21812: Trigger immediate transformation in turtle.shapetransform().
    http://hg.python.org/cpython/rev/39b094798e14

    @rhettinger
    Copy link
    Contributor

    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").

    @rhettinger rhettinger added the type-bug An unexpected behavior, bug, or error label Jun 22, 2014
    @LitaCho
    Copy link
    Mannequin Author

    LitaCho mannequin commented Jun 22, 2014

    Absolutely! I totally forgot I made those changes for PEP-8! Next time, I will totally submit just the change associated with the ticket.

    Thank you, Raymond, for the feedback and reviewing my code!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant