diff options
author | bob <bcz@cs.brown.edu> | 2019-01-29 12:20:13 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-01-29 12:20:13 -0500 |
commit | ed982a553d1831353e312ae8137afa95ef84ebe5 (patch) | |
tree | 6a6510f1cfe9aaa0bef3ae071eebeb63592bb1e0 /src/Utils.ts | |
parent | 0402105238f24785a1229dbbb37f2e4dba958f88 (diff) |
semi working docking, but zooming is now broken.
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 2 |
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; |