-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Rename Image.get_rect()
to Image.copy_rect()
#5421
Comments
Would it be too verbose to call it |
Another option: |
I don't like I'd prefer Some alternatives: I still like |
I feel like a rename is necessary, mostly because of the bigger picture. There's a lot of similar What about |
Note there are many methods across the engine named I agree |
@Mickeon Sorry, I misremembered that @kleonc There is no convention either way, so I'd say both is possible. I think that it is good practice to replace |
I think |
"clip" and "crop" are almost synonyms in common speech. The attempt with this rename is to make sure there is as little ambiguity as possible, and |
You're right. In that case, in an attempt to make naming consistent with the current API, I think Personally, I like "clip" more, so if it's ok to rename |
IMHO |
Overall, it seems like the consensus is that a rename is necessary, but unsure of the new name. Although, I've seen |
Describe the project you are working on
Image Editing Software
Describe the problem or limitation you are having in your project
IMHO
Image.get_rect()
could be named better. It sounds like a getter for aRect2i
with the size of the Image but it copies anImage
out of the rect provided.Image.get_rect()
returns an Image.Image.get_used_rect()
returns a Rect2i.Describe the feature / enhancement and how it helps to overcome the problem or limitation
When you blend or blit an Image you need to provide the rect you want to use from the source image. Probably most often you want to use the full image, so calling
Image.get_rect()
here is an easy mistake to make.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Image copy_rect(rect: Rect2i) const
instead ofImage get_rect(rect: Rect2i) const
If this enhancement will not be used often, can it be worked around with a few lines of script?
It is a minor issue, but a good time to improve it.
Is there a reason why this should be core and not an add-on in the asset library?
Self-explanatory
The text was updated successfully, but these errors were encountered: