Browse Source

fix: 自由布局比例

hsun 6 days ago
parent
commit
1f3291a9de
1 changed files with 2 additions and 2 deletions
  1. 2 2
      services/smart_report.go

+ 2 - 2
services/smart_report.go

@@ -636,10 +636,10 @@ func calculateReportPdfHeight(width int, freeRatio string) (height int, err erro
 		err = fmt.Errorf("布局比例有误, %s", freeRatio)
 		return
 	}
-	if n <= 0 {
+	if m <= 0 {
 		err = fmt.Errorf("布局比例有误, %s", freeRatio)
 		return
 	}
-	height = int(math.Round(float64(width) * m / n))
+	height = int(math.Round(float64(width) * n / m))
 	return
 }