diff options
author | bob <bcz@cs.brown.edu> | 2020-01-31 12:39:59 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2020-01-31 12:39:59 -0500 |
commit | 0c9c2b9fef0b735e4d8398e2a137feb5a6db203a (patch) | |
tree | 54f9174afc69d6fc04d9b8659dd897d603752ef7 /src/Utils.ts | |
parent | b0544ea44ef78a93deb9290815f95d6d9308447d (diff) |
improved labeling for pivot viewer
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) |