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

Rename Image's get_rect to get_region #66017

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

Mickeon
Copy link
Contributor

@Mickeon Mickeon commented Sep 18, 2022

Closes godotengine/godot-proposals#5421.

This PR renames Image's get_rect() to get_region() because the former is very vague, in the grand scheme of things. You may have just barely been able to tell what it does by looking at it.
Also renames its parameter to from "rect" to "region".
Do note that the reason this name was chosen over copy_rect() was because I felt like it didn't quite solve the issue brought up on the proposal. This PR can easily be changed if approved and if there's a clear consensus.

@Mickeon Mickeon requested review from a team as code owners September 18, 2022 00:28
@Mickeon Mickeon force-pushed the rename-image-copy-rect branch from 658d266 to eb0ccea Compare September 18, 2022 00:35
@Mickeon Mickeon requested a review from a team as a code owner September 18, 2022 00:35
@Mickeon Mickeon force-pushed the rename-image-copy-rect branch from eb0ccea to 782b90b Compare September 21, 2022 17:38
@Calinou Calinou added this to the 4.0 milestone Sep 22, 2022
Copy link
Member

@mhilbrunner mhilbrunner left a comment

Choose a reason for hiding this comment

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

PR meeting: we agree the current name is bad, our suggestion would be "get_region()", so if you change it to that one, we can merge 🎉

@Mickeon
Copy link
Contributor Author

Mickeon commented Nov 1, 2022

Will do then, after a well-deserved shower!

@Mickeon Mickeon force-pushed the rename-image-copy-rect branch 2 times, most recently from ce91a08 to 235b4de Compare November 1, 2022 13:17
@Mickeon Mickeon changed the title Rename Image's get_rect to get_cropped_image Rename Image's get_rect to get_region Nov 1, 2022
@Mickeon
Copy link
Contributor Author

Mickeon commented Nov 1, 2022

There we go!

@Mickeon Mickeon requested a review from mhilbrunner November 1, 2022 13:35
@mhilbrunner
Copy link
Member

@Mickeon Docs need to be re-sorted because they're not alphabetical anymore of the change, otherwise looks good to me!

Also renames its parameter to from "rect" to "region".
@Mickeon Mickeon force-pushed the rename-image-copy-rect branch from 235b4de to ebf86c9 Compare November 1, 2022 22:36
@Mickeon
Copy link
Contributor Author

Mickeon commented Nov 1, 2022

Ooops.

Copy link
Member

@mhilbrunner mhilbrunner left a comment

Choose a reason for hiding this comment

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

Approved (as discussed in PR meeting)

@akien-mga akien-mga merged commit 9ec7aad into godotengine:master Nov 2, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename Image.get_rect() to Image.copy_rect()
4 participants