From 4c9d4cde86495128201e05dfdcee37db69f23659 Mon Sep 17 00:00:00 2001 From: DarkFreedman Date: Fri, 4 Oct 2019 12:14:19 +0300 Subject: Update to latest version --- contrib/barcode/barcode.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'contrib/barcode/barcode.go') diff --git a/contrib/barcode/barcode.go b/contrib/barcode/barcode.go index ad84fe5..7e0ac0d 100644 --- a/contrib/barcode/barcode.go +++ b/contrib/barcode/barcode.go @@ -93,13 +93,17 @@ func printBarcode(pdf barcodePdf, code string, x, y float64, w, h *float64, flow } } + scaleToWidthF := float64(scaleToWidth) + scaleToHeightF := float64(scaleToHeight) + if w != nil { - scaleToWidth = int(*w) + scaleToWidthF = *w } if h != nil { - scaleToHeight = int(*h) + scaleToHeightF = *h } - pdf.Image(bname, x, y, float64(scaleToWidth), float64(scaleToHeight), flow, "jpg", 0, "") + + pdf.Image(bname, x, y, scaleToWidthF, scaleToHeightF, flow, "jpg", 0, "") } -- cgit v1.2.1-24-ge1ad