index.js
function getBox (items, i, j) {
	let ilox, iloy, ihix, ihiy, jlox, jloy, jhix, jhiy
	let iitem = items[i], jitem = items[j]

	if (iitem.length > 2) {
		ilox = iitem[0]
		ihix = iitem[2]
		iloy = iitem[1]
		ihiy = iitem[3]
	}
	else if (iitem.length) {
		ilox = iloy = iitem[0]
		ihix = ihiy = iitem[1]
	}
	else {
		ilox = iitem.x
		iloy = iitem.y
		ihix = iitem.x + iitem.width
		ihiy = iitem.y + iitem.height
	}

	if (jitem.length > 2) {
		jlox = jitem[0]
		jhix = jitem[2]
		jloy = jitem[1]
		jhiy = jitem[3]
	}
	else if (jitem.length) {
		jlox = jloy = jitem[0]
		jhix = jhiy = jitem[1]
	}
	else {
		jlox = jitem.x
		jloy = jitem.y
		jhix = jitem.x + jitem.width
		jhiy = jitem.y + jitem.height
	}

	return [ jlox, iloy, jhix, ihiy ]
}
function getBox (items, i, j) {
	let ilox, iloy, ihix, ihiy, jlox, jloy, jhix, jhiy
	let iitem = items[i], jitem = items[j]

	if (iitem.length > 2) {
		ilox = iitem[0]
		ihix = iitem[2]
		iloy = iitem[1]
		ihiy = iitem[3]
	}
	else if (iitem.length) {
		ilox = iloy = iitem[0]
		ihix = ihiy = iitem[1]
	}
	else {
		ilox = iitem.x
		iloy = iitem.y
		ihix = iitem.x + iitem.width
		ihiy = iitem.y + iitem.height
	}

	if (jitem.length > 2) {
		jlox = jitem[0]
		jhix = jitem[2]
		jloy = jitem[1]
		jhiy = jitem[3]
	}
	else if (jitem.length) {
		jlox = jloy = jitem[0]
		jhix = jhiy = jitem[1]
	}
	else {
		jlox = jitem.x
		jloy = jitem.y
		jhix = jitem.x + jitem.width
		jhiy = jitem.y + jitem.height
	}

	return [ jlox, iloy, jhix, ihiy ]
}
function getBox ( items , i , j ) { let ilox , iloy , ihix , ihiy , jlox , jloy , jhix , jhiy let iitem = items [ i ] , jitem = items [ j ] if ( iitem . length > 2 ) { ilox = iitem [ 0 ] ihix = iitem [ 2 ] iloy = iitem [ 1 ] ihiy = iitem [ 3 ] } else if ( iitem . length ) { ilox = iloy = iitem [ 0 ] ihix = ihiy = iitem [ 1 ] } else { ilox = iitem . x iloy = iitem . y ihix = iitem . x + iitem . width ihiy = iitem . y + iitem . height } if ( jitem . length > 2 ) { jlox = jitem [ 0 ] jhix = jitem [ 2 ] jloy = jitem [ 1 ] jhiy = jitem [ 3 ] } else if ( jitem . length ) { jlox = jloy = jitem [ 0 ] jhix = jhiy = jitem [ 1 ] } else { jlox = jitem . x jloy = jitem . y jhix = jitem . x + jitem . width jhiy = jitem . y + jitem . height } return [ jlox , iloy , jhix , ihiy ] }
return bounding box corresponding to a pass
return bounding box corresponding to a pass