trim whitespace for 1D barcode

This commit is contained in:
hardyantz 2017-09-14 18:53:13 +07:00
parent 45e1f5ec9e
commit cf2881238c
1 changed files with 3 additions and 1 deletions

View File

@ -112,7 +112,9 @@ func scale1DCode(bc Barcode, width, height int) (Barcode, error) {
if factor <= 0 {
return nil, fmt.Errorf("can not scale barcode to an image smaller than %dx1", orgWidth)
}
offsetX := (width - (orgWidth * factor)) / 2
width = (orgWidth * factor) + 2
offsetX := 1
wrap := func(x, y int) color.Color {
if x < offsetX {