1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-24 09:08:07 +02:00

Reduce memory use and improve perfs when computing the bounding box of a bezier curve (bug 1875547)

It isn't really a fix for the mentioned bug but it slightly improve things.
In reducing the memory use, the time spent in the GC is reduced either.
The algorithm to compute the bounding box is the same as before but it has just
been rewritten to be more efficient.
This commit is contained in:
Calixte Denizet 2024-01-24 21:16:58 +01:00
parent a5d4660a75
commit 7f2428a77e
5 changed files with 139 additions and 103 deletions

View file

@ -4548,7 +4548,7 @@ describe("annotation", function () {
expect(opList.argsArray[5][0]).toEqual([OPS.moveTo, OPS.curveTo]);
expect(opList.argsArray[5][1]).toEqual([1, 2, 3, 4, 5, 6, 7, 8]);
// Min-max.
expect(opList.argsArray[5][2]).toEqual([1, 1, 2, 2]);
expect(opList.argsArray[5][2]).toEqual([1, 2, 1, 2]);
});
});

View file

@ -771,7 +771,7 @@ describe("api", function () {
[
[OPS.moveTo, OPS.lineTo],
[0, 9.75, 0.5, 9.75],
[0, 0.5, 9.75, 9.75],
[0, 9.75, 0.5, 9.75],
],
null,
]);