wackyneighbor / DC_Text_Watch_Deluxe

DC's Text Watch Deluxe for Pebble Time Round smartwatch
2 stars 1 forks source link

Sunrise & sunset indicators will be shown incorrectly if beyond arctic circles at certain times of the year #3

Closed wackyneighbor closed 8 years ago

wackyneighbor commented 8 years ago

If there is no sunrise or sunset on a given day, the sunrise and/or sunset indicators should be hidden. Currently they are both shown together, at an arbitrary location that I believe corresponds with time zone.

In suncalc.c, lines 59-65: if (cosH > 1) {return 0;} else if (cosH < -1) {return 0;} Add a boolean indicator here. If cosH>1, don't draw sunrise indicator. If cosH>-1, don’t draw sunset indicator. (Maybe create a duplicate procedure with most of the same math, that has boolean output rather than float.)

wackyneighbor commented 8 years ago

Fixed it. Just set time equal to 100 in this case, and stop drawing dot later if that time is found.