3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-02-05 09:55:33 +00:00

Enforce min of .1 for label width and height

This commit is contained in:
Marcus Moore
2025-05-28 14:05:29 -07:00
parent 0df1bc6894
commit a42147ff34

View File

@ -43,8 +43,8 @@ class DefaultLabel extends RectangleSheet
$this->textSize = Helper::convertUnit($settings->labels_fontsize, 'pt', 'in');
$this->labelWidth = $settings->labels_width;
$this->labelHeight = $settings->labels_height;
$this->labelWidth = $this->setLabelWidth($settings);
$this->labelHeight = $this->setLabelHeight($settings);
$this->labelSpacingH = $settings->labels_display_sgutter;
$this->labelSpacingV = $settings->labels_display_bgutter;
@ -181,6 +181,25 @@ class DefaultLabel extends RectangleSheet
}
}
}
private function setLabelWidth(Setting $settings)
{
$labelWidth = $settings->labels_width;
?>
if ($labelWidth == 0) {
$labelWidth = 0.1;
}
return $labelWidth;
}
private function setLabelHeight(?Setting $settings)
{
$labelHeight = $settings->labels_height;
if ($labelHeight == 0) {
$labelHeight = 0.1;
}
return $labelHeight;
}
}