aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-01-31 23:17:10 -0500
committerTyler Schicke <tyler_schicke@brown.edu>2019-01-31 23:17:10 -0500
commitee6e9bb0165e20e717140d2601b3de53d0c5380b (patch)
tree3ec87502e55f4dce8e97f347d957b96c2853d816 /src/Utils.ts
parent4737b47badd10d4209eaf4164ee119f5fd4083ca (diff)
parent8866e324bd7ea8dd03814a840662ca7c3b1a8e0f (diff)
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web
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;