summaryrefslogtreecommitdiff
path: root/contrib/barcode/barcode.go
diff options
context:
space:
mode:
authorDarkFreedman <misterdark@mail.ru>2019-10-04 12:14:19 +0300
committerDarkFreedman <misterdark@mail.ru>2019-10-04 12:14:19 +0300
commit4c9d4cde86495128201e05dfdcee37db69f23659 (patch)
treebcc51f0f0b585ced9b68f1003972847db619e402 /contrib/barcode/barcode.go
parent4ca1a43173413971a6bb92c78be31a71b29b416b (diff)
Update to latest version
Diffstat (limited to 'contrib/barcode/barcode.go')
-rw-r--r--contrib/barcode/barcode.go10
1 files changed, 7 insertions, 3 deletions
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, "")
}