TA159

Notas, resueltos y trabajos practicos de la materia Sistemas Gráficos
Index Commits Files Refs Submodules README LICENSE
commit 32215a6cdac9928dba922f16219c8dce927a91c3
parent b935c5c228d45477ef327b4aa4b5b3f97c45c888
Author: Martin Kloeckner <mjkloeckner@gmail.com>
Date:   Thu,  4 Jul 2024 12:00:34 -0300

update gui when using keybindings

Diffstat:
Mtp/src/scene.js | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tp/src/scene.js b/tp/src/scene.js
@@ -120,10 +120,8 @@ function setupThreeJs() {
                 console.log("Toggling train animations");
                 settings.animationEnable = !settings.animationEnable;
                 if(gui != undefined) {
-                    let controller = gui.__controllers.find(controller => controller.property === 'animationEnable');
-                    if (controller) {
-                        controller.updateDisplay();
-                    }
+                    // update gui 'Animations' checkbox
+                    gui.__controllers[0].updateDisplay();
                 }
                 break
         }