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:
james 2009-03-05 20:55:06 +00:00
parent 2fafcfd844
commit 7674cf3fbe

View File

@ -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;
}