From 55f4ff5ff3cda0f56e74a6ba3f518f616d88696c Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Tue, 7 Oct 2025 18:30:08 -0400 Subject: [PATCH] Resolves gh-22: Dispatches a redraw event when the Room is redrawn. --- src/room.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/room.js b/src/room.js index 91bb44a..6635704 100644 --- a/src/room.js +++ b/src/room.js @@ -132,7 +132,9 @@ export class SpatialRoom extends EventTarget { // which is displayed on the lock screen if the user puts their // device to sleep manually, as well as on connected devices // such as an Apple Watch. - noSleep.noSleepVideo.setAttribute("title", "Audimance") + if (noSleep.noSleepVideo) { + noSleep.noSleepVideo.setAttribute("title", "Audimance") + } } enableAudio() { @@ -245,6 +247,8 @@ export class SpatialRoom extends EventTarget { .attr("x", function(d) { return self.scaleX(d.location.x + self.data.dimensions.width/2) }) .attr("y", function(d) { return self.scaleY(self.data.dimensions.depth/2-d.location.z) }) .attr("dy", "2em") + + this.dispatchEvent(new Event("redraw")) } }