1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Remove TryCatch in canvas fill

As verified by @Rob--W, the evenodd fill rule works correctly in all supported browsers. This now allows optimization by JS engines.

This fixes #5458
This commit is contained in:
Fabian Lange 2014-11-09 13:53:50 +01:00
parent 9f5abd70d7
commit 063ca95f5f
2 changed files with 6 additions and 14 deletions

View file

@ -1096,12 +1096,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
ctx.fill();
ctx.mozFillRule = 'nonzero';
} else {
try {
ctx.fill('evenodd');
} catch (ex) {
// shouldn't really happen, but browsers might think differently
ctx.fill();
}
ctx.fill('evenodd');
}
this.pendingEOFill = false;
} else {
@ -2110,12 +2105,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
ctx.clip();
ctx.mozFillRule = 'nonzero';
} else {
try {
ctx.clip('evenodd');
} catch (ex) {
// shouldn't really happen, but browsers might think differently
ctx.clip();
}
ctx.clip('evenodd');
}
} else {
ctx.clip();