diff options
author | mehekj <mehek.jethani@gmail.com> | 2022-06-02 13:32:17 -0400 |
---|---|---|
committer | mehekj <mehek.jethani@gmail.com> | 2022-06-02 13:32:17 -0400 |
commit | eee5c6e67b25c0ff49289458acea0ef6f11d92de (patch) | |
tree | 652b91ba9881c4fb45b07df5ae56ead79e26013f /src/Utils.ts | |
parent | 53cae5e2ab9267295a824ff721c119ada5e5dc20 (diff) | |
parent | 30347f1ac971b3299cfbefd5505e20f5e82702e0 (diff) |
Merge branch 'inking-naafi-mehek' into master-cleanup
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), |