Skip to content

Commit

Permalink
[#391] Exception when write a barcode with PureBarcode false
Browse files Browse the repository at this point in the history
  • Loading branch information
micjahn committed Jan 24, 2022
1 parent f6aadf3 commit eb22aaf
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions Clients/WindowsFormsDemo/EncodingOptionsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public EncodingOptionsForm()

cmbRenderer.Items.Add(typeof(BitmapRenderer));
cmbRenderer.Items.Add(typeof(CustomBitmapRenderer));
cmbRenderer.Items.Add(typeof(AlternateBitmapRenderer));
cmbRenderer.SelectedItem = typeof(BitmapRenderer);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public Bitmap Render(BitMatrix matrix, BarcodeFormat format, string content, Enc
{
var textAreaHeight = font.Height;

emptyArea = height + 10 > textAreaHeight ? textAreaHeight : 0;
emptyArea = height > textAreaHeight ? textAreaHeight : 0;

if (emptyArea > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public Bitmap Render(BitMatrix matrix, BarcodeFormat format, string content, Enc
{
var textAreaHeight = (int)font.LineHeight;

emptyArea = height + 10 > textAreaHeight ? textAreaHeight : 0;
emptyArea = height > textAreaHeight ? textAreaHeight : 0;
}

// output content text below the barcode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public SKBitmap Render(BitMatrix matrix, BarcodeFormat format, string content, E
var backcolor = (uint) Background;
var textAreaHeight = (int) (TextSize < 1 ? 10 : TextSize);

emptyArea = outputContent && height + 10 > textAreaHeight ? textAreaHeight : 0;
emptyArea = outputContent && height > textAreaHeight ? textAreaHeight : 0;

for (int y = 0; y < matrix.Height - emptyArea; y++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ virtual public Bitmap Render(BitMatrix matrix, BarcodeFormat format, string cont
{
var textAreaHeight = font.Height;

emptyArea = height + 10 > textAreaHeight ? textAreaHeight : 0;
emptyArea = height > textAreaHeight ? textAreaHeight : 0;

if (emptyArea > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public System.DrawingCore.Bitmap Render(BitMatrix matrix, BarcodeFormat format,
{
var textAreaHeight = font.Height;

emptyArea = height + 10 > textAreaHeight ? textAreaHeight : 0;
emptyArea = height > textAreaHeight ? textAreaHeight : 0;

if (emptyArea > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/lib/renderer/BitmapRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ virtual public Bitmap Render(BitMatrix matrix, BarcodeFormat format, string cont
var textAreaHeight = font.Height;
#endif

emptyArea = height + 10 > textAreaHeight ? textAreaHeight : 0;
emptyArea = height > textAreaHeight ? textAreaHeight : 0;

if (emptyArea > 0)
{
Expand Down

0 comments on commit eb22aaf

Please sign in to comment.