diff --git a/Sources/Code39/Code39View.swift b/Sources/Code39/Code39View.swift index 51cad95..2094a94 100644 --- a/Sources/Code39/Code39View.swift +++ b/Sources/Code39/Code39View.swift @@ -17,7 +17,7 @@ public struct Code39View: View { public var body: some View { Canvas { context, size in - let intercharacterGapCount = barcode.count % 9 + let intercharacterGapCount = (barcode.count % 9) - 1 let narrowBarWidth = size.width / CGFloat(((((barcode.count - intercharacterGapCount) / 9) * 15) + intercharacterGapCount)) var currentX: CGFloat = 0 for (index, barWidth) in barcode.enumerated() {