aboutsummaryrefslogtreecommitdiff
path: root/src/ClientUtils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-11-01 10:53:37 -0400
committerbobzel <zzzman@gmail.com>2024-11-01 10:53:37 -0400
commitb6411c0c053db2b4495d0c545c491d9f18238e21 (patch)
treebe8e635b77a27d8c6beace9338b3756cb3ba6c46 /src/ClientUtils.ts
parentd234aebe441aced1b6d947653a1b36c226439103 (diff)
fixed resize problem where NaN is generated by scaling very narrow in a card view.
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;