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 numberOfVisibleLines = Math.floor(totalHeight / lineHeight);
|
||||
|
||||
let firstIndex;
|
||||
if (valueIndices.length === 1) {
|
||||
const valuePosition = valueIndices[0];
|
||||
const indexInPage = valuePosition % numberOfVisibleLines;
|
||||
firstIndex = valuePosition - indexInPage;
|
||||
} else {
|
||||
// If nothing is selected (valueIndice.length === 0), we render
|
||||
// from the first element.
|
||||
firstIndex = valueIndices.length ? valueIndices[0] : 0;
|
||||
let firstIndex = 0;
|
||||
if (valueIndices.length > 0) {
|
||||
const minIndex = Math.min(...valueIndices);
|
||||
const maxIndex = Math.max(...valueIndices);
|
||||
|
||||
firstIndex = Math.max(0, maxIndex - numberOfVisibleLines + 1);
|
||||
if (firstIndex > minIndex) {
|
||||
firstIndex = minIndex;
|
||||
}
|
||||
}
|
||||
const end = Math.min(firstIndex + numberOfVisibleLines + 1, lineCount);
|
||||
|
||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -596,3 +596,4 @@
|
||||
!issue14755.pdf
|
||||
!issue16473.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",
|
||||
"rounds": 1,
|
||||
"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