aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index 948b6176e..cc1d8f6c6 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -13,7 +13,7 @@ export class Utils {
public static GetScreenTransform(ele: HTMLElement): { scale: number, translateX: number, translateY: number } {
const rect = ele.getBoundingClientRect();
- const scale = rect.width / ele.offsetWidth;
+ const scale = ele.offsetWidth == 0 && rect.width == 0 ? 1 : rect.width / ele.offsetWidth;
const translateX = rect.left;
const translateY = rect.top;