Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added area kwarg to mask.to_surface #2670

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Matiiss
Copy link
Member

@Matiiss Matiiss commented Jan 15, 2024

Close #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 Matiiss requested a review from a team as a code owner January 15, 2024 02:34
@Matiiss Matiiss added New API This pull request may need extra debate as it adds a new class or function to pygame mask pygame.mask labels Jan 15, 2024
@MyreMylar
Copy link
Member

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.

Copy link
Member

@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Matiiss
Copy link
Member Author

Matiiss commented Jun 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mask pygame.mask New API This pull request may need extra debate as it adds a new class or function to pygame
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mask.to_surface (1070)
2 participants