From 3ef92e98feedd9c8b59a3cadaecd7b78aae01529 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Mon, 25 Jul 2022 15:10:01 +0200 Subject: [PATCH] don't "round" ground / null alt colors --- html/planeObject.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/html/planeObject.js b/html/planeObject.js index 6340612..64336dd 100644 --- a/html/planeObject.js +++ b/html/planeObject.js @@ -763,10 +763,6 @@ PlaneObject.prototype.getMarkerColor = function(options) { function altitudeColor(altitude) { let h, s, l; - const altRound = (webgl && !pTracks && !SelectedAllPlanes) ? 200 : 500; - // round altitude to limit the number of colors used - altitude = altRound * Math.round(altitude / altRound); - if (altitude == null) { h = ColorByAlt.unknown.h; s = ColorByAlt.unknown.s; @@ -776,6 +772,10 @@ function altitudeColor(altitude) { s = ColorByAlt.ground.s; l = ColorByAlt.ground.l; } else { + const altRound = (webgl && !pTracks && !SelectedAllPlanes) ? 200 : 500; + // round altitude to limit the number of colors used + altitude = altRound * Math.round(altitude / altRound); + s = ColorByAlt.air.s; // find the pair of points the current altitude lies between,