-
Notifications
You must be signed in to change notification settings - Fork 47
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
Hit Area Tool vertices and lines misaligned for containers #284
Comments
I can reproduce it, thanks! By the way, the container object is always at 0,0. The editor does a trick with the origin tool for moving around the children so it simulates a change in the origin. I will work on this issue. |
PhaserEditor2D
added a commit
that referenced
this issue
May 23, 2023
PhaserEditor2D
added a commit
that referenced
this issue
May 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When adding a Hit Area to a container if the origin of the group isn't set at 0,0 the hit area vertices and lines are misaligned.
The misalignment happens most for the polygon shape but the origin of the hit area is unexpected even when using rectangles so I would assume the same root issue would apply
Screenshots
Showing the origin of the container. It was set using the origin tool and is important for this particular project
![image](https://private-user-images.githubusercontent.com/28418166/239713246-27030ed0-cad7-4b70-b1ac-095d11f3c752.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg4NjUzMDEsIm5iZiI6MTcxODg2NTAwMSwicGF0aCI6Ii8yODQxODE2Ni8yMzk3MTMyNDYtMjcwMzBlZDAtY2FkNy00YjcwLWIxYWMtMDk1ZDExZjNjNzUyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIwVDA2MzAwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNmMTI4YTdiNDBhMWU1OTc0YTAwNGVhNjRjOTkwYTQzYWY1NDBhYmM2Mjc3NWQ0YzBkMDc4ODAzMmJmMjA4YWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.U1N93x17b_ucDhYgnMgcB3UupEFAUib_dkArig3Ym30)
Using the hit area polygon tool you can see how the vertices seem like they're in an okay location but the lines don't match up
![image](https://private-user-images.githubusercontent.com/28418166/239713250-350b3a45-8388-4aa7-9b06-e4d5b5f95519.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg4NjUzMDEsIm5iZiI6MTcxODg2NTAwMSwicGF0aCI6Ii8yODQxODE2Ni8yMzk3MTMyNTAtMzUwYjNhNDUtODM4OC00YWE3LTliMDYtZTRkNWI1Zjk1NTE5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIwVDA2MzAwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVlOTI1ZGZkMmFjZDg0OTE3NzU1YmQ0YmRkOGY2MGExZDEzMGExYzAwNzY3Y2ZjYzJkNzJhOWY0YWFhNGMwNGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.njyG4Ounc3xVy59l0kvYvEfWCYUyYihkjSgi9fZ1GcY)
Reproduction Steps.
Possible solution
Account for group origin when drawing the lines and vertices in the editor.
Workaround for now after testing is knowing that the lines are accurately representing the hit area and the vertices are not in the correct location
Ideally the original instantiation of the hit area should be based on the container origin and scale since creating the hit area for a container has strange behavior when starting and is often too small and off center
Thanks for looking at this. The new tool is amazing and this seems like a pretty edge case scenario
The text was updated successfully, but these errors were encountered: