mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-27 13:34:19 -04:00
Add Codablock options to Studio
Also remove divide by zero bug calculating row height
This commit is contained in:
parent
c351ed492e
commit
0dd072437e
5 changed files with 36 additions and 11 deletions
|
@ -378,23 +378,22 @@ static int hibc(struct zint_symbol *symbol, unsigned char source[], size_t lengt
|
|||
|
||||
static void check_row_heights(struct zint_symbol *symbol) {
|
||||
/* Check that rows with undefined heights are never less than 5x */
|
||||
int large_bar_count;
|
||||
int large_bar_count = 0;
|
||||
int i;
|
||||
int preset_height;
|
||||
int large_bar_height;
|
||||
int preset_height = 0;
|
||||
int large_bar_height = 0;
|
||||
|
||||
large_bar_count = 0;
|
||||
preset_height = 0;
|
||||
for (i = 0; i < symbol->rows; i++) {
|
||||
preset_height += symbol->row_height[i];
|
||||
if (symbol->row_height[i] == 0) {
|
||||
large_bar_count++;
|
||||
}
|
||||
}
|
||||
large_bar_height = (symbol->height - preset_height) / large_bar_count;
|
||||
|
||||
|
||||
if (large_bar_count == 0) {
|
||||
symbol->height = preset_height;
|
||||
} else {
|
||||
large_bar_height = (symbol->height - preset_height) / large_bar_count;
|
||||
}
|
||||
|
||||
if (large_bar_height < 5) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue