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

swap left shift operators for Math.pow for scoped projection/unprojection #172

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

saranrapjs
Copy link
Contributor

With the caveat that I'm not very fluent in bitwise operators, and I'm not totally sure I can point to the part of the Javascript spec that explains why this fix works, and the left shift operators don't...but it seems like, in Safari at least, 1 << 15.5 == 1 << 15, which is unexpected.

This branch uses Math.pow instead — where (again, in Safari) Math.pow(2, 15.5) != Math.pow(2, 15), which is expected.

fixes #171

@bdon
Copy link
Member

bdon commented Sep 12, 2024

Makes sense, the bit shifting operations only work on 32 bit integers; can you fix the CI formatting failures? then good to merge

@bdon bdon merged commit 15cb30e into protomaps:main Sep 12, 2024
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.

Fractional display zoom support in Static frontend
2 participants