[locale] Adjust latitude calculation in the southern hemisphere

The scaling on the map was a little off; the degrees of latitude
are a little wider there than around the equator and Europe.

 - Johannesburg is in the right spot
 - Hobart is no longer a suburb of Melbourne
 - Punta Arenas is in Chile
This commit is contained in:
Adriaan de Groot 2018-05-29 05:52:07 -04:00
parent 9f8f76befc
commit 2c18ba6ddb

View File

@ -138,6 +138,10 @@ QPoint TimeZoneWidget::getLocationPosition( double longitude, double latitude )
// country, and Inuvik isn't in the ocean. // country, and Inuvik isn't in the ocean.
if ( latitude > 62.0 ) if ( latitude > 62.0 )
y -= sin( MATH_PI * ( latitude - 62.0 ) / 56.0 ) * MAP_Y_OFFSET * height; y -= sin( MATH_PI * ( latitude - 62.0 ) / 56.0 ) * MAP_Y_OFFSET * height;
// Far south, some stretching occurs as well, but it is less pronounced.
// Move down by 1 pixel per 5 degrees past 10 south
if ( latitude < - 14 )
y += int( (-latitude) / 5.0 );
// Antarctica isn't shown on the map, but you could try clicking there // Antarctica isn't shown on the map, but you could try clicking there
if ( latitude < -60 ) if ( latitude < -60 )
y = height - 1; y = height - 1;