aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-01-29 12:20:13 -0500
committerbob <bcz@cs.brown.edu>2019-01-29 12:20:13 -0500
commited982a553d1831353e312ae8137afa95ef84ebe5 (patch)
tree6a6510f1cfe9aaa0bef3ae071eebeb63592bb1e0 /src/Utils.ts
parent0402105238f24785a1229dbbb37f2e4dba958f88 (diff)
semi working docking, but zooming is now broken.
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;