Skip to content

Commit

Permalink
Merge pull request #18 from TravisBernard/master
Browse files Browse the repository at this point in the history
Merge patch for issue #18 - in some cases, items that only fit in a single orientation were being recorded as fitting in the alternate, impossible one.
  • Loading branch information
dvdoug committed Nov 19, 2014
2 parents cfb8610 + c7a510e commit edde226
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Packer.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public function packIntoBox(Box $aBox, ItemList $aItems) {
$remainingWeight -= $itemToPack->getWeight();

if ($fitsRotatedGap < 0 ||
$fitsSameGap <= $fitsRotatedGap ||
($fitsSameGap >= 0 && $fitsSameGap <= $fitsRotatedGap) ||
(!$aItems->isEmpty() && $aItems->top() == $itemToPack && $remainingLength >= 2 * $itemLength)) {
$this->logger->log(LogLevel::DEBUG, "fits (better) unrotated");
$remainingLength -= $itemLength;
Expand Down

0 comments on commit edde226

Please sign in to comment.