mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge pull request #8006 from timvandermeij/mozFillRule
Remove usage of `mozFillRule`
This commit is contained in:
commit
3f320f0b11
2 changed files with 3 additions and 21 deletions
|
@ -1229,13 +1229,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
}
|
||||
|
||||
if (this.pendingEOFill) {
|
||||
if (ctx.mozFillRule !== undefined) {
|
||||
ctx.mozFillRule = 'evenodd';
|
||||
ctx.fill();
|
||||
ctx.mozFillRule = 'nonzero';
|
||||
} else {
|
||||
ctx.fill('evenodd');
|
||||
}
|
||||
ctx.fill('evenodd');
|
||||
this.pendingEOFill = false;
|
||||
} else {
|
||||
ctx.fill();
|
||||
|
@ -2273,13 +2267,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
var ctx = this.ctx;
|
||||
if (this.pendingClip) {
|
||||
if (this.pendingClip === EO_CLIP) {
|
||||
if (ctx.mozFillRule !== undefined) {
|
||||
ctx.mozFillRule = 'evenodd';
|
||||
ctx.clip();
|
||||
ctx.mozFillRule = 'nonzero';
|
||||
} else {
|
||||
ctx.clip('evenodd');
|
||||
}
|
||||
ctx.clip('evenodd');
|
||||
} else {
|
||||
ctx.clip();
|
||||
}
|
||||
|
|
|
@ -372,13 +372,7 @@ var tests = [
|
|||
var ctx = canvas.getContext('2d');
|
||||
ctx.rect(1, 1, 50, 50);
|
||||
ctx.rect(5, 5, 41, 41);
|
||||
|
||||
if ('mozFillRule' in ctx) {
|
||||
ctx.mozFillRule = 'evenodd';
|
||||
ctx.fill();
|
||||
} else {
|
||||
ctx.fill('evenodd');
|
||||
}
|
||||
ctx.fill('evenodd');
|
||||
|
||||
var data = ctx.getImageData(0, 0, 50, 50).data;
|
||||
var isEvenOddFill = data[20 * 4 + 20 * 200 + 3] == 0 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue