ignore minSize if parent is too small

This commit is contained in:
Nathan Cahill
2018-11-06 09:48:52 -07:00
parent 22a1c4cc65
commit 9f0c5bf123
2 changed files with 5 additions and 1 deletions

View File

@@ -381,6 +381,10 @@ const Split = (idsOption, options = {}) => {
return sizesToTrim
}
if (minSizes.reduce((a, b) => a + b, 0) > parentSize) {
return sizesToTrim
}
// Keep track of the excess pixels, the amount of pixels over the desired percentage
// Also keep track of the elements with pixels to spare, to decrease after if needed
let excessPixels = 0