mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Make sure the columns and rows can never be 0
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
5645141f93
commit
0cb76a049a
|
@ -62,6 +62,16 @@ class DefaultLabel extends RectangleSheet
|
|||
|
||||
$this->columns = ($usableWidth + $this->labelSpacingH) / ($this->labelWidth + $this->labelSpacingH);
|
||||
$this->rows = ($usableHeight + $this->labelSpacingV) / ($this->labelHeight + $this->labelSpacingV);
|
||||
|
||||
// Make sure the columns and rows are never zero, since that scenario should never happen
|
||||
if ($this->columns == 0) {
|
||||
$this->columns = 1;
|
||||
}
|
||||
|
||||
if ($this->rows == 0) {
|
||||
$this->rows = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getUnit() { return 'in'; }
|
||||
|
|
Loading…
Reference in a new issue