Try to not omit some values when printing a choice list with several selected items
This commit is contained in:
parent
a2118f52b0
commit
0e610cab04
@ -3334,15 +3334,15 @@ class ChoiceWidgetAnnotation extends WidgetAnnotation {
|
|||||||
const vPadding = (lineHeight - fontSize) / 2;
|
const vPadding = (lineHeight - fontSize) / 2;
|
||||||
const numberOfVisibleLines = Math.floor(totalHeight / lineHeight);
|
const numberOfVisibleLines = Math.floor(totalHeight / lineHeight);
|
||||||
|
|
||||||
let firstIndex;
|
let firstIndex = 0;
|
||||||
if (valueIndices.length === 1) {
|
if (valueIndices.length > 0) {
|
||||||
const valuePosition = valueIndices[0];
|
const minIndex = Math.min(...valueIndices);
|
||||||
const indexInPage = valuePosition % numberOfVisibleLines;
|
const maxIndex = Math.max(...valueIndices);
|
||||||
firstIndex = valuePosition - indexInPage;
|
|
||||||
} else {
|
firstIndex = Math.max(0, maxIndex - numberOfVisibleLines + 1);
|
||||||
// If nothing is selected (valueIndice.length === 0), we render
|
if (firstIndex > minIndex) {
|
||||||
// from the first element.
|
firstIndex = minIndex;
|
||||||
firstIndex = valueIndices.length ? valueIndices[0] : 0;
|
}
|
||||||
}
|
}
|
||||||
const end = Math.min(firstIndex + numberOfVisibleLines + 1, lineCount);
|
const end = Math.min(firstIndex + numberOfVisibleLines + 1, lineCount);
|
||||||
|
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -596,3 +596,4 @@
|
|||||||
!issue14755.pdf
|
!issue14755.pdf
|
||||||
!issue16473.pdf
|
!issue16473.pdf
|
||||||
!bug1529502.pdf
|
!bug1529502.pdf
|
||||||
|
!issue16500.pdf
|
||||||
|
BIN
test/pdfs/issue16500.pdf
Executable file
BIN
test/pdfs/issue16500.pdf
Executable file
Binary file not shown.
@ -7694,5 +7694,18 @@
|
|||||||
"md5": "4830e765a3d6cb64d39b84de11178f6e",
|
"md5": "4830e765a3d6cb64d39b84de11178f6e",
|
||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "issue16500",
|
||||||
|
"file": "pdfs/issue16500.pdf",
|
||||||
|
"md5": "6466546aaa5fcf31235bdf100496705c",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq",
|
||||||
|
"print": true,
|
||||||
|
"annotationStorage": {
|
||||||
|
"7R": {
|
||||||
|
"value": ["Three", "Five"]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user