[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] pygame.transform.rotozoom



Sorry to bother you again with this, but I think there is a bug in the implementation of pygame.transform.rotate and pygame.transform.rotozoom in PyGame 1.3 (on Windows).

I know it is documented as destructive, but something is going wrong:

when img is a 16x16 image, then
  imgT = pygame.transform.rotozoom(img, -90, 1)
gives me a 18x18 imgT

Now I think that shouldn't happen.

What I see is that it is rotated (good) but also shifted down and right. Some background or default color is added in the "new" pixel row and the "new" pixel column.

with the same img, a 16x16 image, then
  imgT = pygame.transform.rotate(img, -90)
gives me a 16x16 imgT

16x16 sounds good... but, I think it uses pygame.transform.rotozoom in the implementation and just returns a 16x16 surface (based on original 16x16 surface put into it). Thus it gives back the "new" pixel row and the "new" pixel column and loses some information on the right and the bottom sides.

I think solving the rotozoom issue might solve the rotate issue at the same time, but I didn't look at the code. From earlier discussion I understand there is a SDL_rotozoom thing behind this, maybe it is a bug in that portion?

Here is my test application showing the problem:
  http://fvw.freezope.org/PyGame/showPossibleError.zip
or if you prefer, the files seperately:
  http://fvw.freezope.org/PyGame/showPossibleError.py
  http://fvw.freezope.org/PyGame/showPossibleError.bmp

Can anyone confirm my results?  Maybe it is just an issue on Windows, and/or is is solved in CVS?  I use the PyGame 1.3 distribution for Windows.

Frank
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org