From ade97cffc3cd4c0f5cce7285e0ca7dc059b3d68f Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Fri, 23 Oct 2020 11:01:20 +0200 Subject: [PATCH] avoid some icon rotation changes --- html/planeObject.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/html/planeObject.js b/html/planeObject.js index 3a872b3..9225aff 100644 --- a/html/planeObject.js +++ b/html/planeObject.js @@ -821,9 +821,10 @@ PlaneObject.prototype.updateIcon = function() { } */ - if (this.rotationCache == null || Math.abs(this.rotationCache - this.rotation) > 0.15) { - this.rotationCache = this.rotation; - this.markerIcon.setRotation(this.baseMarker.noRotate ? 0 : this.rotation * Math.PI / 180.0); + const iconRotation = this.baseMarker.noRotate ? 0 : this.rotation; + if (this.rotationCache != iconRotation && Math.abs(this.rotationCache - iconRotation) > 0.35) { + this.rotationCache = iconRotation; + this.markerIcon.setRotation(iconRotation * Math.PI / 180.0); } if (this.scaleCache != this.scale) {