pygame-ce
pygame-ce copied to clipboard
Added `area` kwarg to `mask.to_surface`
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)
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.
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.