mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[Editor] Allow Float32Array for quadpoints in annotations (bug 1907958)
Added annotations could have some quadpoints (highlight, ink). The isNumberArray check was returning false and consequently the annotation wasn't printable. The tests didn't catch this issue because the quadpoints were passed as Array. So driver.js has been updated in order to pass them as Float32Array in order to be in a situation similar to the real life one.
This commit is contained in:
parent
f6b356eff7
commit
5f95d9b1ba
2 changed files with 18 additions and 4 deletions
|
@ -610,7 +610,7 @@ class Driver {
|
|||
|
||||
if (task.annotationStorage) {
|
||||
for (const annotation of Object.values(task.annotationStorage)) {
|
||||
const { bitmapName } = annotation;
|
||||
const { bitmapName, quadPoints } = annotation;
|
||||
if (bitmapName) {
|
||||
promise = promise.then(async doc => {
|
||||
const response = await fetch(
|
||||
|
@ -643,6 +643,11 @@ class Driver {
|
|||
return doc;
|
||||
});
|
||||
}
|
||||
if (quadPoints) {
|
||||
// Just to ensure that the quadPoints are always a Float32Array
|
||||
// like IRL (in order to avoid bugs like bug 1907958).
|
||||
annotation.quadPoints = new Float32Array(quadPoints);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue