Skip to content

Commit

Permalink
Add workaround for calcuation involving items with 0 depth. Fixes #159
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdoug committed Nov 18, 2018
1 parent cd0d7d1 commit 4cb1612
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OrientatedItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function getTippingPoint()
if (isset(static::$tippingPointCache[$cacheKey])) {
$tippingPoint = static::$tippingPointCache[$cacheKey];
} else {
$tippingPoint = atan(min($this->length, $this->width) / $this->depth);
$tippingPoint = atan(min($this->length, $this->width) / ($this->depth ?: 1));
static::$tippingPointCache[$cacheKey] = $tippingPoint;
}

Expand Down

0 comments on commit 4cb1612

Please sign in to comment.