on xenial help sign in
use const declarations where appropriate
commit060cb88e3f59d7b22943504083f09562c6f3352a authorLukáš Tinkl <lukas.tinkl@canonical.com> dateMon 4 Jan 2016, 16:23 (11 years ago) parent5650062
1 file changed+9−9
qml/Wizard/Pages/50-timezone.qml+9−9
qml/Wizard/Pages/50-timezone.qml+9−9
@@ -40,24 +40,24 @@ LocalComponents.Page {
4040
4141 // geo coords conversion functions (adapted from libtimezonemap)
4242 function radians(degrees) {
43− return degrees * Math.PI / 180;
43+ return degrees * Math.PI / 180;
4444 }
4545
4646 function longitudeToX(longitude, map_width) {
47− var xdeg_offset = -6;
48− var x = (map_width * (180.0 + longitude) / 360.0) + (map_width * xdeg_offset / 180.0);
47+ const xdeg_offset = -6;
48+ const x = (map_width * (180.0 + longitude) / 360.0) + (map_width * xdeg_offset / 180.0);
4949 return x;
5050 }
5151
5252 function latitudeToY(latitude, map_height) {
53− var bottom_lat = -59;
54− var top_lat = 81;
53+ const bottom_lat = -59;
54+ const top_lat = 81;
5555
56− var top_per = top_lat / 180.0;
56+ const top_per = top_lat / 180.0;
5757 var y = 1.25 * Math.log(Math.tan(0.25*Math.PI + 0.4 * radians(latitude)));
58− var full_range = 4.6068250867599998;
59− var top_offset = full_range * top_per;
60− var map_range = Math.abs(1.25 * Math.log(Math.tan(0.25*Math.PI + 0.4 * radians(bottom_lat))) - top_offset);
58+ const full_range = 4.6068250867599998;
59+ const top_offset = full_range * top_per;
60+ const map_range = Math.abs(1.25 * Math.log(Math.tan(0.25*Math.PI + 0.4 * radians(bottom_lat))) - top_offset);
6161 y = Math.abs(y - top_offset);
6262 y = y / map_range;
6363 y = y * map_height;