Fix issue with annotation at certain zooms #21
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to resolve #19. The root of the problem is that whether or not the Sun was entirely inside the Moon depended on the screen resolution - basically, a small sliver of the Sun not covered by the Moon would be lost at low zoom due to screen resolution. This, combined with the fact that we'd already changed the Sun-Moon distance calculation to use a more precise method meant that we were trying to solve a screen-space describing the intersection of the circles, when no such intersection existed.
The solution here is to essentially free ourselves of some of the resolution-based issues by using the fraction pixel values where the sun and moon centers "should" be. This should keep everything in agreement and allow us to "know" that the Sun isn't completely covered by the Moon, even when the resolution of the annotation on the screen says otherwise.