From 699574b2039fc7d370fdd49cd238f35203e49898 Mon Sep 17 00:00:00 2001 From: Doug Wright Date: Sun, 6 Aug 2017 15:12:02 +0100 Subject: [PATCH] Check all constraints when stacking --- VolumePacker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VolumePacker.php b/VolumePacker.php index a25df088..446449a8 100644 --- a/VolumePacker.php +++ b/VolumePacker.php @@ -254,7 +254,7 @@ protected function tryAndStackItemsIntoSpace( $maxLength, $maxDepth ) { - while (!$this->items->isEmpty() && $this->remainingWeight >= $this->items->top()->getWeight()) { + while (!$this->items->isEmpty() && $this->checkNonDimensionalConstraints($this->items->top(), $packedItems)) { $stackedItem = $this->getOrientationForItem( $this->items->top(), $prevItem,