Commits

otus committed 5c5ad73

Fix TextureSpriteRenderer ignoring x and y for single sprites

  • Participants
  • Parent commits 390d83d
  • Branches bug-fixes

Comments (0)

Files changed (1)

File sdl2/ext/sprite.py

                 if rcopy(renderer, sp.texture, None, r) == -1:
                     raise SDLError()
         else:
-            if x is None or y is None:
-                r.x = sprites.x
-                r.y = sprites.y
-                r.w, r.h = sprites.size
+            r.x = sprites.x
+            r.y = sprites.y
+            r.w, r.h = sprites.size
+            if x is not None and y is not None:
+                r.x = x
+                r.y = y
             render.SDL_RenderCopy(self.sdlrenderer, sprites.texture, None, r)
         render.SDL_RenderPresent(self.sdlrenderer)