aboutsummaryrefslogtreecommitdiff
path: root/src/ClientUtils.ts
diff options
context:
space:
mode:
authoreleanor-park <eleanor_park@brown.edu>2024-11-11 01:18:58 -0500
committereleanor-park <eleanor_park@brown.edu>2024-11-11 01:18:58 -0500
commit8a01bf324f8313306a578b6e8d5736d8bfcd7dd9 (patch)
tree3996410b27758bcf292d8ed4f4bf18b64b48fc4a /src/ClientUtils.ts
parent41a8e1c7f1943145bf7099c70ef3eb6540fe0d26 (diff)
parent4ab636e338a11e8153d43adddb0e0d3e6bad57ec (diff)
changes for demo
Diffstat (limited to 'src/ClientUtils.ts')
-rw-r--r--src/ClientUtils.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ClientUtils.ts b/src/ClientUtils.ts
index baad9a06c..8f62b9060 100644
--- a/src/ClientUtils.ts
+++ b/src/ClientUtils.ts
@@ -165,7 +165,7 @@ export namespace ClientUtils {
return { scale: 0, translateX: 1, translateY: 1 };
}
const rect = ele.getBoundingClientRect();
- const scale = ele.offsetWidth === 0 && rect.width === 0 ? 1 : rect.width / ele.offsetWidth;
+ const scale = ele.offsetWidth === 0 && rect.width === 0 ? 1 : rect.width / (ele.offsetWidth || 1);
const translateX = rect.left;
const translateY = rect.top;