diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2019-02-25 01:31:27 -0500 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-02-25 01:31:27 -0500 |
commit | 1a32bdca177faf5a3d99bcb45aaf596ba8c706a8 (patch) | |
tree | 1f7531be1ae4032cbb5de0e54a9ae48fda9657cc /src/Utils.ts | |
parent | b418a6ed64e50700e2935963f01e392cbd81099d (diff) | |
parent | db7aa80be56e2d91acf224013b24ab73385f836c (diff) |
Merge branch 'authentication' of https://github.com/browngraphicslab/Dash-Web into authentication
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index c9c006aa8..d4b7da52c 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -2,15 +2,6 @@ import v4 = require('uuid/v4'); import v5 = require("uuid/v5"); import { Socket } from 'socket.io'; import { Message, Types } from './server/Message'; -import { Field } from './fields/Field'; -import { TextField } from './fields/TextField'; -import { NumberField } from './fields/NumberField'; -import { RichTextField } from './fields/RichTextField'; -import { Key } from './fields/Key'; -import { ImageField } from './fields/ImageField'; -import { ListField } from './fields/ListField'; -import { Document } from './fields/Document'; -import { Server } from './client/Server'; export class Utils { @@ -23,6 +14,9 @@ export class Utils { } public static GetScreenTransform(ele: HTMLElement): { scale: number, translateX: number, translateY: number } { + if (!ele) { + return { scale: 1, translateX: 1, translateY: 1 } + } const rect = ele.getBoundingClientRect(); const scale = ele.offsetWidth == 0 && rect.width == 0 ? 1 : rect.width / ele.offsetWidth; const translateX = rect.left; |