Skip to content

Commit

Permalink
Fix url angle in free-flight not applying correctly. Fixes: #485
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Nov 18, 2023
1 parent 6d3774f commit c7af5e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 7 additions & 5 deletions BlueMapCommon/webapp/src/js/BlueMapApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,12 @@ export class BlueMapApp {
}
}

switch (values[9]) {
case "flat" : this.setFlatView(0); break;
case "free" : this.setFreeFlight(0, controls.position.y); break;
default : this.setPerspectiveView(0); break;
}

controls.position.x = parseFloat(values[1]);
controls.position.y = parseFloat(values[2]);
controls.position.z = parseFloat(values[3]);
Expand All @@ -717,11 +723,7 @@ export class BlueMapApp {
controls.tilt = parseFloat(values[7]);
controls.ortho = parseFloat(values[8]);

switch (values[9]) {
case "flat" : this.setFlatView(0); break;
case "free" : this.setFreeFlight(0, controls.position.y); break;
default : this.setPerspectiveView(0); break;
}
this.updatePageAddress();

return true;
}
Expand Down
6 changes: 5 additions & 1 deletion BlueMapCommon/webapp/src/js/util/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ export const animate = function (animationFrame, durationMs = 1000, postAnimatio
}
};

window.requestAnimationFrame(time => animation.frame(time));
if (durationMs !== 0) {
window.requestAnimationFrame(time => animation.frame(time));
} else {
animation.frame(0);
}

return animation;
}
Expand Down

0 comments on commit c7af5e9

Please sign in to comment.