From 6b3299e6ffda4064c7861b9dc020079df12215bc Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 29 May 2018 07:56:50 -0400 Subject: [PATCH] [locale] Adjust the North - Fudge the numbers in the North, to improve location of the pins and lines of latitude. - Inuvik, Yellowknife, Cambridge Bay, Resolute look ok - Thule, Scoresbysund look ok; Danmarkshavn a pixel or so too far North - Reykjavik is a bit too far North - Longyearbyen is a bit too far North Since these places are off by one or two pixels, this becomes invisible when a large pin + text label is placed on it. --- .../locale/timezonewidget/timezonewidget.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/modules/locale/timezonewidget/timezonewidget.cpp b/src/modules/locale/timezonewidget/timezonewidget.cpp index 5acdb6458..64557c151 100644 --- a/src/modules/locale/timezonewidget/timezonewidget.cpp +++ b/src/modules/locale/timezonewidget/timezonewidget.cpp @@ -148,11 +148,21 @@ QPoint TimeZoneWidget::getLocationPosition( double longitude, double latitude ) // of there, and we have a funny "rounded" top of the world. In practice the locations // of the different cities / regions looks ok -- at least Thule ends up in the right // country, and Inuvik isn't in the ocean. - if ( latitude > 62.0 ) - y -= sin( MATH_PI * ( latitude - 62.0 ) / 56.0 ) * MAP_Y_OFFSET * height; + if ( latitude > 70.0 ) + y -= sin( MATH_PI * ( latitude - 70.0 ) / 56.0 ) * MAP_Y_OFFSET * height * 0.8; + if ( latitude > 74.0 ) + y += 4; + if ( latitude > 69.0 ) + y -= 2; + if ( latitude > 59.0 ) + y -= 4 * int( ( latitude - 54.0 ) / 5.0 ); + if ( latitude > 54.0 ) + y -= 2; + if ( latitude > 49.0 ) + y -= int ( (latitude - 44.0) / 5.0 ); // 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 ) + if ( latitude < 0 ) y += int( (-latitude) / 5.0 ); // Antarctica isn't shown on the map, but you could try clicking there if ( latitude < -60 )