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

Rotate player markers in the correct direction when passing due-north orientation #357

Merged
merged 1 commit into from
Jan 12, 2025

Conversation

joshuaprince
Copy link
Contributor

2025-01-10.20-48-44.webm

When a player rotates so that they pass the "due-north" angle, their angle goes from (e.g.) 359deg to 1deg, and the CSS transform treats this as a full 358-degree counterclockwise rotation. Very mildly annoying!

Instead, by finding the closest equivalent angle, all rotations are as short as they can be.

2025-01-10.20-49-58.webm

Logic credit: https://stackoverflow.com/a/53416030

Verified

This commit was signed with the committer’s verified signature.
joshuaprince Joshua Prince
… orientation
@joshuaprince
Copy link
Contributor Author

Just spotted #313 which this fixes.

Copy link
Owner

@jpenilla jpenilla left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@jpenilla jpenilla linked an issue Jan 12, 2025 that may be closed by this pull request
@jpenilla jpenilla merged commit 3746f4b into jpenilla:master Jan 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strange behavior of player marker when turning between certain angles
2 participants