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

Fixed width of CapsuleShape2D::get_rect + set center to center of shape #77065

Merged
merged 1 commit into from May 15, 2023

Conversation

FranckRJ
Copy link
Contributor

The width of the rect was only half of the width of the shape, and the 0;0 coord was at the top left of the rect.
Now the width properly matches the width of the shape, and the 0;0 coord is at the center of the shape. It should match the behavior of Godot 3.X (https://github.com/godotengine/godot/blob/3.x/scene/resources/capsule_shape_2d.cpp#L93-L99).

I haven't found a test file for CapsuleShape2D, I don't know if I have to create one or if it should be written in an existing file, or something else.

The width of the rect was only half of the width of the shape, and
the 0;0 coord was at the top left of the rect.
Now the width properly matches the width of the shape, and the 0;0
coord is at the center of the shape. It should match the behavior
of Godot 3.X.
@FranckRJ FranckRJ force-pushed the fix-capsuleshape2d-getrect branch from e21b2e0 to ab5462e Compare May 14, 2023 16:11
Copy link
Member

@kleonc kleonc left a comment

Choose a reason for hiding this comment

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

LGTM.

@akien-mga akien-mga merged commit 37fd9a3 into godotengine:master May 15, 2023
13 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

For the record, your commit seems not to be linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info.

@FranckRJ FranckRJ deleted the fix-capsuleshape2d-getrect branch May 15, 2023 07:52
@FranckRJ
Copy link
Contributor Author

Fixed it, thanks for notifying me.

I started using godot last week and it seems to be a really great product, I hope I'll be able to contribute more in the future!

@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.4.

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.

None yet

4 participants