Add 'force Data Matrix to square symbol' option.

This commit is contained in:
hooper114 2009-08-14 16:52:08 +00:00
parent 17c504e724
commit 0d5c7cf9d3
2 changed files with 16 additions and 1 deletions

View file

@ -799,7 +799,7 @@ int data_matrix_200(struct zint_symbol *symbol, unsigned char source[])
}
}
calcsize++;
if(calcsize <= optionsize) {
symbolsize = optionsize;
} else {
@ -810,6 +810,19 @@ int data_matrix_200(struct zint_symbol *symbol, unsigned char source[])
strcpy(symbol->errtxt, "Data does not fit in selected symbol size");
}
}
if(symbol->option_3 == DM_SQUARE) {
/* Force to use square symbol */
switch(symbolsize) {
case 2:
case 4:
case 6:
case 9:
case 11:
case 14:
symbolsize++;
}
}
H = matrixH[symbolsize];
W = matrixW[symbolsize];