pygame-ce icon indicating copy to clipboard operation
pygame-ce copied to clipboard

Added `area` kwarg to `mask.to_surface`

Open Matiiss opened this issue 1 year ago • 4 comments
trafficstars

Close https://github.com/pygame-community/pygame-ce/issues/661 (I don't think any of that renaming mentioned there is going to happen, so, adding the area kwarg is about all there's left to it)

Matiiss avatar Jan 15 '24 02:01 Matiiss

Should the size of the area rectangle also be used to determine the size of the final surface created here - where no surface is provided?

It feels a bit odd to effectively ask for a chunk of a mask to be turned into a surface and then get more than that chunk back.

MyreMylar avatar Feb 12 '24 13:02 MyreMylar

Going to approve this, despite my slight quibbles about functionality as I think it will work either way. How it currently works is more similar to the .blit() version of the area parameter -but it does feel more logical to produce a cropped mask surface if we aren't explicitly supplying a surface.

I did use .blit()'s implementation as a reference, it made sense for this to be consistent with that at the time.

Matiiss avatar Jun 07 '24 23:06 Matiiss