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

Fix axis snapping of CollisionPolygon2D's newly created vertex #64050

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

pulawskig
Copy link
Contributor

Closes #64012

In CollisionPolygon2D when you add a new vertex via clicking on an existing edge, that vertex can immediately be moved without releasing the left mouse button.
A copy collection of polygon vertexes that is used to determine their positions prior to being moved was populated before the new vertex was added which caused a critical error when later trying to reference that vertex when moving. This reference access only occured when snapping to axis via holding Shift key.
This fixes this behaviour by populating the collection after adding the new vertex.

@pulawskig pulawskig requested a review from a team as a code owner August 7, 2022 13:18
@Calinou Calinou added this to the 4.0 milestone Aug 7, 2022
@Calinou Calinou added cherrypick:3.x Considered for cherry-picking into a future 3.x release cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release labels Aug 7, 2022
@akien-mga akien-mga merged commit 335b51b into godotengine:master Aug 8, 2022
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.6.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Aug 8, 2022
@akien-mga
Copy link
Member

Cherry-picked for 3.5.1.

@akien-mga akien-mga removed the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Aug 8, 2022
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.

Holding Shift while moving vertices in CollisionPolygon2D crashes Godot
3 participants