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 `Surface.fill` with rects with negative positions that overlap the surface #2939

Closed oddbookworm closed 2 days ago

oddbookworm commented 1 week ago

Fixes #2938

Starbuck5 commented 1 week ago

Since this is such an old bug, it could probably get a note in the docs?

Also is there really not a standard way of implementing clip rects, like SDL_IntersectRect maybe? What do the blitters do?

oddbookworm commented 1 week ago

Since this is such an old bug, it could probably get a note in the docs?

Also is there really not a standard way of implementing clip rects, like SDL_IntersectRect maybe? What do the blitters do?

Note added

I replaced all the custom clipping with SDL_IntersectRect, but in SDL3, that function is renamed (left a comment in the code)

ankith26 commented 2 days ago

Okay, seems like no one has opposed this fix so far, so let's get this in now.