Fix issue with layout determination
This commit is contained in:
parent
fd3662e6b2
commit
cb6a13fafd
|
@ -117,7 +117,9 @@
|
|||
})
|
||||
|
||||
// Calculate the variance between each set of positions on the children
|
||||
const variances = Object.keys(childCoords[0]).map(key => {
|
||||
const variances = Object.keys(childCoords[0])
|
||||
.filter(x => x !== "placeholder")
|
||||
.map(key => {
|
||||
const coords = childCoords.map(x => x[key])
|
||||
return {
|
||||
variance: variance(coords),
|
||||
|
@ -130,6 +132,7 @@
|
|||
variances.sort((a, b) => {
|
||||
return a.variance < b.variance ? -1 : 1
|
||||
})
|
||||
console.log(variances[0].side)
|
||||
const column = ["centerX", "left", "right"].includes(variances[0].side)
|
||||
console.log(column ? "COL" : "ROW")
|
||||
|
||||
|
|
Loading…
Reference in New Issue