Skip to content

Commit 713d2cf

Browse files
committed
remove hard-coded default
1 parent 37e49ac commit 713d2cf

4 files changed

Lines changed: 9 additions & 35 deletions

File tree

src/BinaryKits.Zpl.Label/Elements/ZplQrCode.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.Text;
33

44
namespace BinaryKits.Zpl.Label.Elements
@@ -9,6 +9,7 @@ public class ZplQrCode : ZplFieldDataElementBase
99
public int MagnificationFactor { get; private set; }
1010
public ErrorCorrectionLevel ErrorCorrectionLevel { get; private set; }
1111
public int MaskValue { get; private set; }
12+
public int VerticalQuietZone { get; private set; }
1213

1314
/// <summary>
1415
/// Zpl QrCode
@@ -24,6 +25,7 @@ public class ZplQrCode : ZplFieldDataElementBase
2425
/// <param name="hexadecimalIndicator"></param>
2526
/// <param name="bottomToTop"></param>
2627
/// <param name="useDefaultPosition"></param>
28+
/// <param name="verticalQuietZone">The vertical quiet zone (usually set with <c>^BY,,X</c>)</param>
2729
public ZplQrCode(
2830
string content,
2931
int positionX,
@@ -35,13 +37,15 @@ public ZplQrCode(
3537
FieldOrientation fieldOrientation = FieldOrientation.Normal,
3638
char? hexadecimalIndicator = null,
3739
bool bottomToTop = false,
38-
bool useDefaultPosition = false)
40+
bool useDefaultPosition = false,
41+
int verticalQuietZone = 10)
3942
: base(content, positionX, positionY, fieldOrientation, hexadecimalIndicator, bottomToTop, useDefaultPosition)
4043
{
4144
Model = model;
4245
MagnificationFactor = magnificationFactor;
4346
ErrorCorrectionLevel = errorCorrectionLevel;
4447
MaskValue = maskValue;
48+
VerticalQuietZone = verticalQuietZone;
4549
}
4650

4751
///<inheritdoc/>

src/BinaryKits.Zpl.Viewer/CommandAnalyzers/FieldDataZplCommandAnalyzer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using BinaryKits.Zpl.Label;
22
using BinaryKits.Zpl.Label.Elements;
3-
using BinaryKits.Zpl.Viewer.Elements;
43
using BinaryKits.Zpl.Viewer.Models;
54

65
using System;
@@ -88,7 +87,7 @@ public override ZplElementBase Analyze(string zplCommand, VirtualPrinter virtual
8887
{
8988
(ErrorCorrectionLevel errorCorrection, string parsedText) = this.ParseQrCodeFieldData(qrCode, text);
9089
// N.B.: always pass Field Orientation Normal to QR codes; the ZPL II standard does not allow rotation
91-
return new ZplQrCodeViewer(parsedText, x, y, qrCode.Model, qrCode.MagnificationFactor, errorCorrection, qrCode.MaskValue, FieldOrientation.Normal, hexadecimalIndicator, bottomToTop, useDefaultPosition, virtualPrinter.BarcodeInfo.Height);
90+
return new ZplQrCode(parsedText, x, y, qrCode.Model, qrCode.MagnificationFactor, errorCorrection, qrCode.MaskValue, FieldOrientation.Normal, hexadecimalIndicator, bottomToTop, useDefaultPosition, virtualPrinter.BarcodeInfo.Height);
9291
}
9392
else if (virtualPrinter.NextElementFieldData is UpcABarcodeFieldData upcA)
9493
{

src/BinaryKits.Zpl.Viewer/ElementDrawers/QrCodeElementDrawer.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using BinaryKits.Zpl.Label;
22
using BinaryKits.Zpl.Label.Elements;
3-
using BinaryKits.Zpl.Viewer.Elements;
43
using BinaryKits.Zpl.Viewer.Helpers;
54

65
using SkiaSharp;
@@ -23,13 +22,13 @@ public class QrCodeElementDrawer : BarcodeDrawerBase
2322
///<inheritdoc/>
2423
public override bool CanDraw(ZplElementBase element)
2524
{
26-
return element is ZplQrCodeViewer;
25+
return element is ZplQrCode;
2726
}
2827

2928
///<inheritdoc/>
3029
public override SKPoint Draw(ZplElementBase element, DrawerOptions options, SKPoint currentPosition, InternationalFont internationalFont)
3130
{
32-
if (element is ZplQrCodeViewer qrcode)
31+
if (element is ZplQrCode qrcode)
3332
{
3433
float x = qrcode.PositionX;
3534
float y = qrcode.PositionY;

src/BinaryKits.Zpl.Viewer/Elements/ZplQrCodeViewer.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)