Fixed missing hidden PIE and PIN controls printing

This commit is contained in:
Willem Cazander 2025-01-07 19:57:31 +01:00
parent 3abd987584
commit 4122e24ad4
2 changed files with 9 additions and 1 deletions

View file

@ -195,6 +195,14 @@ public class FourCornerUnicodeDisplay {
}
numberMode = cdc.next();
numberPIE = FCDotCDC1604DashP6.__PIE.ordinal() == cdcPoint; // is false for PIN
if (renderHiddenControls) {
if (numberPIE) {
buf.append(FCDotCDC1604DashP6.escapeSignUnicode(FCDotCDC1604DashP6.__PIE.ordinal()));
} else {
buf.append(FCDotCDC1604DashP6.escapeSignUnicode(FCDotCDC1604DashP6.__PIN.ordinal()));
}
buf.appendCodePoint(FCDotCDC1604DashP6.indexOf(numberMode).codePoints()[0]);
}
if (numberMode < FCDotCDC1604DashP6.NX01_A.ordinal()) {
cdcPoint = numberMode; // print char
numberMode = null; // illegal number mode

View file

@ -82,7 +82,7 @@ public class FourCornerUnicodeDisplayTest {
cdc.add(FCDotCDC1604DashP6.NX15_O);
Assertions.assertEquals("ab B␃cD.jklmO", FourCornerUnicodeDisplay.text().renderFromX06(cdc));
Assertions.assertEquals("ab B␃cD.jklm␃␃O", FourCornerUnicodeDisplay.text(true).renderFromX06(cdc));
Assertions.assertEquals("␁Za␁Zb B␃cD.␁Zjklm␃␃O", FourCornerUnicodeDisplay.text(true).renderFromX06(cdc));
}
@Test