Fix for reset north when rotation is 360 degrees

Animated reset north doesn't work and isn't needed if rotation is 360 degrees (or a multiple of 360)
This commit is contained in:
mike-000
2020-01-10 13:39:29 +00:00
committed by GitHub
parent c851f6c6bf
commit 0512c690f8

View File

@@ -131,8 +131,9 @@ class Rotate extends Control {
// upon it
return;
}
if (view.getRotation() !== undefined) {
if (this.duration_ > 0) {
const rotation = view.getRotation();
if (rotation !== undefined) {
if (this.duration_ > 0 && rotation % (2 * Math.PI) !== 0) {
view.animate({
rotation: 0,
duration: this.duration_,