pygame-community / pygame-ce

🐍🎮 pygame - Community Edition is a FOSS Python library for multimedia applications (like games). Built on top of the excellent SDL library.
https://pyga.me
766 stars 120 forks source link

Fix scaled-after-non-scaled usage #2925

Open ankith26 opened 2 weeks ago

ankith26 commented 2 weeks ago

this PR fixes #2737 and fixes #2376 (they are essentially the same issue).

Note that I couldn't reproduce the original issue on Ubuntu, however @zoldalma999 has tested this branch and reported that this fix has worked on windows. Would be nice if someone gave this a test on a mac as well.

Also worth mentioning that the fix only works for SDL 2.28.0+, but all the wheels we distribute are on 2.30.3 so this shouldn't be a big deal.

It was also mentioned in one of the linked issues that #2571 is also the same issue, but I don't think that's the case.

ankith26 commented 1 week ago

A bit of interesting history: these new API functions were basically added for us by the SDL folks in response to issue #2190 so we have to make use of it!

rethanon commented 3 days ago

This does seem to fix #2737 but doesn't appear to fix #2376. I tested it today and the error still happens on my Mac (but is fixed on my Windows 11 machine)

ankith26 commented 1 day ago

It doesn't fix #2376 as of now, but SDL has patched the underlying issue and the fix should be available in the next SDL bump, so let this PR wait for that