TextureSpriteRenderer mishandles x and y for single sprites

Issue #19 resolved
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:

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. Marcus von Appen repo owner
    • fixed issue #19: the sdl2.ext.TextureSpriteRenderer and
      sdl2.ext.SoftwareSpriteRenderer misinterpret the x and y arguments,
      when set to 0.
    • fixed sdl2.SDL_GL_GetDrawableSize() function for non-hg SDL2 versions

    → <<cset c9584f25067b>>

  3. Log in to comment