forked from science-ation/science-ation
Fix a divide by zero when "scale columns" was set to yes, but there were no scalable columns to scale
This commit is contained in:
parent
2fafcfd844
commit
7674cf3fbe
@ -586,8 +586,10 @@ foreach($report_stock as $n=>$v) {
|
||||
* we can enforce margins) */
|
||||
if($report['option']['fit_columns'] == 'yes') { // && $total_width > $label_stock['label_width']) {
|
||||
$static_width = $total_width - $scale_width;
|
||||
$scale_factor = ($label_stock['label_width'] - $static_width) / $scale_width;
|
||||
//echo "$scale_factor;
|
||||
if($scale_width)
|
||||
$scale_factor = ($label_stock['label_width'] - $static_width) / $scale_width;
|
||||
else
|
||||
$scale_factor = 1.0;
|
||||
} else {
|
||||
$scale_factor = 1.0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user