diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2020-01-31 13:04:42 -0500 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2020-01-31 13:04:42 -0500 |
commit | 7689cc7730a172a901edfca640736f80583a20b5 (patch) | |
tree | eb618abc624c03f3ca73159f72ac7c3fda52e103 /src/Utils.ts | |
parent | 45d0cae98af1f4621b031b0934875ad3baeb312f (diff) | |
parent | e34620f6ded8afd6bb3f96c2c2889c9165f64569 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index 4deac9035..13bdb990d 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -328,10 +328,10 @@ export function timenow() { return now.toLocaleDateString() + ' ' + h + ':' + m + ' ' + ampm; } -export function aggregateBounds(boundsList: { x: number, y: number, width: number, height: number }[], xpad: number, ypad: number) { +export function aggregateBounds(boundsList: { x: number, y: number, width: number, height?: number }[], xpad: number, ypad: number) { const bounds = boundsList.reduce((bounds, b) => { const [sptX, sptY] = [b.x, b.y]; - const [bptX, bptY] = [sptX + b.width, sptY + b.height]; + const [bptX, bptY] = [sptX + b.width, sptY + (b.height || 0)]; return { x: Math.min(sptX, bounds.x), y: Math.min(sptY, bounds.y), r: Math.max(bptX, bounds.r), b: Math.max(bptY, bounds.b) |