Fix for 3d heightmap / 3d view conflict (#360)

This commit is contained in:
evolvedexperiment 2019-11-11 21:53:23 +02:00 committed by Azgaar
parent 354eb74746
commit 257cf11986
2 changed files with 21 additions and 2 deletions

View file

@ -432,6 +432,7 @@ function changeViewMode(event) {
const button = event.target;
enterStandardView();
if (button.classList.contains("pressed")) {
button.classList.remove("pressed");
viewStandard.classList.add("pressed");
@ -442,7 +443,20 @@ function changeViewMode(event) {
}
}
function disable3dViews() {
viewMesh.disabled = true;
viewGlobe.disabled = true;
}
function enable3dViews() {
viewMesh.disabled = false;
viewGlobe.disabled = false;
}
function enterStandardView() {
viewMode.querySelectorAll(".pressed").forEach(button => button.classList.remove("pressed"));
viewStandard.classList.add("pressed");
if (!document.getElementById("canvas3d")) return;
ThreeD.stop();
document.getElementById("canvas3d").remove();
@ -555,4 +569,4 @@ function toggle3dOptions() {
function changeResolution() {
ThreeD.setResolution(this.value);
}
}
}