-
Notifications
You must be signed in to change notification settings - Fork 319
box2d: Correct mixup of the x and y coordinates #2391
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
box2d: Correct mixup of the x and y coordinates #2391
Conversation
The relative space type of the set position block in Box2D was set incorrectly such that it set the y position relative to the current x position rather than the y position. This means that setting inputs of -2, 20 would result in the sprite going negative in both directions, with the y coordinate always being +20 > the x coordinate. Fix was changing character 13723:62 to a y, instead of an x.
|
I'll investigate this |
Brackets-Coder
left a comment
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 confirm this fixes a typo that breaks expected behavior. Nice catch!
- I tested all modified functionality and found no bugs or unintuitive behavior.
- I believe a well-formed project using an older version of this extension will not be broken by this new version. -
some projects may use workarounds to fix this manually, so fixing it in the extension may break their workarounds. I can't confirm this but it's such a trivial change that I'm going to approve - I have no additional concerns.
|
oops accidentally double-commented @SharkPool-SP or @PPPDUD could you review and approve so we can get this merged? |
|
This will break compatibility |
|
Yes, it will, but is it a sacrifice we're willing to make? It's likely that we're going to have users create issues about it not working if this is merged but it's also not working as intended right now |
|
Eh good point |
|
Alright I'ma go ahead and merge |
The relative space type of the set position block in Box2D was set incorrectly such that it set the y position relative to the current x position rather than the y position.
This means that setting inputs of -2, 20 would result in the sprite going negative in both directions, with the y coordinate always being +20 > the x coordinate. (see below video)
The following video shows the incorrect behavior (current) and the corrected behavior (this patch) using the same script:
box2d-tw-change-showcase.mp4
Didn't look before making this change but I'm pretty sure this patch resolves this issue:
Fixes #935
Also, I think this bug is almost 7 years old, since I found the original patch in Griffpatch's VM fork, and it's from February 2019.