diff options
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index dbae0aa8c..6f3a31b49 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -5,6 +5,12 @@ import { Socket } from 'socket.io'; import { Colors } from './client/views/global/globalEnums'; import { Message } from './server/Message'; import Color = require('color'); +import { InkTool } from './fields/InkField'; +import { action } from 'mobx'; +import { CurrentUserUtils } from './client/util/CurrentUserUtils'; +import { CollectionFreeFormView } from './client/views/collections/collectionFreeForm'; +import { WidthSym, HeightSym } from './fields/Doc'; +import { NumCast } from './fields/Types'; export namespace Utils { export let DRAG_THRESHOLD = 4; @@ -414,6 +420,7 @@ export function formatTime(time: number) { return (hours ? hours.toString() + ":" : "") + minutes.toString().padStart(2, '0') + ':' + seconds.toString().padStart(2, '0'); } +// x is furthest left, y is furthest top, r is furthest right, b is furthest bottom export function aggregateBounds(boundsList: { x: number, y: number, width?: number, height?: number }[], xpad: number, ypad: number) { const bounds = boundsList.map(b => ({ x: b.x, y: b.y, r: b.x + (b.width || 0), b: b.y + (b.height || 0) })).reduce((bounds, b) => ({ x: Math.min(b.x, bounds.x), y: Math.min(b.y, bounds.y), |