From daf2924be8a3a48f8cfb27089c89d211ca271952 Mon Sep 17 00:00:00 2001 From: Minoru Akagi Date: Fri, 12 Jan 2024 17:11:38 +0900 Subject: [PATCH] animation: show play button when scene has been loaded --- js/Qgis2threejs.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/js/Qgis2threejs.js b/js/Qgis2threejs.js index ef66040d..edf80107 100644 --- a/js/Qgis2threejs.js +++ b/js/Qgis2threejs.js @@ -374,8 +374,15 @@ Q3D.E = function (id) { } app.render(); - if (conf.animation.startOnLoad) { - app.animation.keyframes.start(); + if (conf.animation.enabled) { + var btn = E("animbtn"); + if (btn) { + btn.className = "playbtn"; + } + + if (conf.animation.startOnLoad) { + app.animation.keyframes.start(); + } } }, true); @@ -1520,8 +1527,6 @@ Q3D.E = function (id) { if (conf.animation.enabled && btn) { var anim = app.animation.keyframes; - btn.classList.remove("hidden"); - var playButton = function () { btn.className = "playbtn"; }; @@ -1530,8 +1535,6 @@ Q3D.E = function (id) { btn.className = "pausebtn"; }; - playButton(); - btn.onclick = function () { if (anim.isActive) { anim.pause();