Issue #19 resolved

TextureSpriteRenderer mishandles x and y for single sprites

otus
created an issue

The docstring for TextureSpriteRenderer says x and y are used as absolute position when a single TextureSprite is passed, but the code actually renders to an empty rect (i.e. nowhere) instead.

Testcase: add x=10, y=10 to the render call in helloworld.py example and run it with the -hardware switch.

Suggested fix is here: https://bitbucket.org/otus/py-sdl2/commits/5c5ad73975c4460a2337f081256777ec5f7ad2b9

Comments (3)

  1. otus reporter

    Actually, SoftwareSpriteRenderer doesn't quite work as advertised either. You can't reposition something to the origin, since it treats 0 and None similarly. The next commit in my fork is a candidate fix.

  2. Log in to comment