mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #16722 from calixteman/dont_set_filter
Don't uselessly change the filter when drawing (bug 1508765)
This commit is contained in:
commit
d74b68cd09
1 changed files with 8 additions and 2 deletions
|
@ -790,7 +790,10 @@ function resetCtxToDefault(ctx) {
|
|||
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
||||
!isNodeJS
|
||||
) {
|
||||
ctx.filter = "none";
|
||||
const { filter } = ctx;
|
||||
if (filter !== "none" && filter !== "") {
|
||||
ctx.filter = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2961,7 +2964,10 @@ class CanvasGraphics {
|
|||
// It must be applied to the image before rescaling else some artifacts
|
||||
// could appear.
|
||||
// The final restore will reset it to its value.
|
||||
ctx.filter = "none";
|
||||
const { filter } = ctx;
|
||||
if (filter !== "none" && filter !== "") {
|
||||
ctx.filter = "none";
|
||||
}
|
||||
}
|
||||
|
||||
// scale the image to the unit square
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue