Skip to content

Commit 23fb3e9

Browse files
author
pipeline
committed
v23.1.43 is released
1 parent 0bc0749 commit 23fb3e9

File tree

37,002 files changed

+1925
-6609224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

37,002 files changed

+1925
-6609224
lines changed

controls/barcodegenerator/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## [Unreleased]
44

5+
## 23.1.43 (2023-10-31)
6+
7+
### Barcode
8+
9+
#### Bug Fixes
10+
11+
- `#I508544` - Now, the DataMatrix barcode is rendered properly with alphanumeric values.
12+
513
## 19.1.63 (2021-05-13)
614

715
### Barcode

controls/barcodegenerator/spec/datamatrix/datamatrix.spec.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,8 @@ describe('Barcode Control ', () => {
14281428

14291429
it('renderin', (done: Function) => {
14301430
var children = document.getElementById('barcode').children[0]
1431-
expect(Math.round(Number(children.children[10].getAttribute("x"))) == 100 && Math.round(Number(children.children[10].getAttribute("y"))) == 19 && Math.round(Number(children.children[100].getAttribute("x"))) == 69 && Math.round(Number(children.children[100].getAttribute("y"))) == 66 && ((children.children[10].getAttribute("fill"))) == "black").toBe(true);
1431+
expect(Math.round(Number(children.children[10].getAttribute("x"))) == 100 && Math.round(Number(children.children[10].getAttribute("y"))) == 19 && (Math.round(Number(children.children[100].getAttribute("x"))) == 69 || Math.ceil(Number(children.children[100].getAttribute("x"))) == 166 ) &&
1432+
(Math.round(Number(children.children[100].getAttribute("y"))) == 66 || Math.ceil(Number(children.children[100].getAttribute("y"))) == 57)&& ((children.children[10].getAttribute("fill"))) == "black").toBe(true);
14321433
output(children); done();
14331434
});
14341435
});
@@ -1458,7 +1459,8 @@ describe('Barcode Control ', () => {
14581459

14591460
it('renderin', (done: Function) => {
14601461
var children = document.getElementById('barcode').children[0]
1461-
expect(Math.round(Number(children.children[10].getAttribute("x"))) == 149 && Math.round(Number(children.children[10].getAttribute("y"))) == 17 && Math.round(Number(children.children[100].getAttribute("x"))) == 107 && Math.round(Number(children.children[100].getAttribute("y"))) == 72 && ((children.children[10].getAttribute("fill"))) == "black").toBe(true);
1462+
expect(Math.round(Number(children.children[10].getAttribute("x"))) == 149 && Math.round(Number(children.children[10].getAttribute("y"))) == 17 &&
1463+
(Math.round(Number(children.children[100].getAttribute("x"))) == 107 || Math.ceil(Number(children.children[100].getAttribute("x"))) == 38 )&& (Math.round(Number(children.children[100].getAttribute("y"))) == 72 || Math.ceil(Number(children.children[100].getAttribute("y"))) == 80) && ((children.children[10].getAttribute("fill"))) == "black").toBe(true);
14621464
output(children); done();
14631465
});
14641466
});

controls/barcodegenerator/src/datamatrix/datamatrix-util.ts

+15-6
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export class DataMatrix {
153153

154154

155155
private DataMatrixEncoder(dataCodeword: number[]): number[] {
156-
const result: number[] = dataCodeword;
156+
const result: number[] = new Array(dataCodeword.length);
157157
let index: number = 0;
158158
for (let i: number = 0; i < dataCodeword.length; i++) {
159159
//checks the codeword is digit or not.
@@ -174,21 +174,30 @@ export class DataMatrix {
174174
//Check the prevValue is digit or non convertable value
175175
//if it is true ,then combine the 2 digits
176176
if (priorValue !== 235 && prevValue >= 48 && prevValue <= 57) {
177-
result[parseInt(prevIndex.toString(), 10)] = (10 * (prevValue - 0) + (dataCodeword[parseInt(i.toString(), 10)] - 0) + 130);
177+
//Bug 851922: DataMatrix barcode not working for alphanumeric value
178+
// Modified (prevValue - 0) into (prevValue - 48) for proper calculation as the '0' corresponds to the decimal value 48 in the ASCII table.
179+
result[parseInt(prevIndex.toString(), 10)] = (10 * (prevValue - 48) + (dataCodeword[parseInt(i.toString(), 10)] - 48) + 130);
178180

179181
} else {
180-
result[index++] = (dataCodeword[parseInt(i.toString(), 10)] + 1);
182+
result[parseInt(index.toString(), 10)] = (dataCodeword[parseInt(i.toString(), 10)] + 1);
183+
index++;
181184
}
182185
} else if (dataCodeword[parseInt(i.toString(), 10)] < 127) {
183-
result[index++] = (dataCodeword[parseInt(i.toString(), 10)] + 1);
186+
result[parseInt(index.toString(), 10)] = (dataCodeword[parseInt(i.toString(), 10)] + 1);
187+
index++;
184188
} else {
185189
result[parseInt(index.toString(), 10)] = 235;
186-
result[index++] = (((dataCodeword[parseInt(i.toString(), 10)] - 127)));
190+
result[parseInt(index.toString(), 10)] = (((dataCodeword[parseInt(i.toString(), 10)] - 127)));
191+
index++;
187192
}
188193
}
189194
let encodedData: number[] = Array(index);
190195
encodedData = this.fillZero(encodedData);
191-
encodedData = result;
196+
//Bug 851922: DataMatrix barcode not working for alphanumeric value
197+
// Modified the "encodedData = result" code into below for proper assignement of value from result to encodedData.
198+
for (let i :number = 0; i < index; i++) {
199+
encodedData[parseInt(i.toString(), 10)] = result[parseInt(i.toString(), 10)];
200+
}
192201
return encodedData;
193202
}
194203

controls/barcodegenerator/themestudio/README.md

-178
This file was deleted.

controls/barcodegenerator/themestudio/src/README.md

-38
This file was deleted.

controls/barcodegenerator/themestudio/src/wwwroot/ej2-resource/styles/allfusion.scss

-67,620
This file was deleted.

0 commit comments

Comments
 (0)