-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Implementation of pygame.(F)Rect.rel_center
#3089
base: main
Are you sure you want to change the base?
Conversation
I'm not sure about the x and y variants, as |
@@ -2804,6 +2814,33 @@ RectExport_getcenter(RectObject *self, void *closure) | |||
self->r.y + (self->r.h / 2)); | |||
} | |||
|
|||
/*center*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relcenter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you brought up a point, should it be rel_center
or relcenter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of hate it, but probably relcenter
for consistency with the other pre-existing rect attributes.
It seems to me like most uses would be related to |
With the argument you gave with damus, indeed |
I agree that the feature is logical and should probably be implemented, but I wonder if there are more use cases than the one given:
If I understand this case correctly, one could use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename it relcenter
? Then I think we can get this in.
Implementation of #1242 according to MyreMylar name proposal.
While I'm bringing this feature to a potential release, what's your opinion on
rel_centerx
andrel_centery
?Closes #1242 .
Tests + documentation added.