mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Adds fill('evenodd') as alternative for mozFillRule
This commit is contained in:
parent
f87de639af
commit
abc890a9be
2 changed files with 53 additions and 34 deletions
|
@ -362,10 +362,13 @@ var tests = [
|
|||
var ctx = canvas.getContext('2d');
|
||||
ctx.rect(1, 1, 50, 50);
|
||||
ctx.rect(5, 5, 41, 41);
|
||||
['fillRule', 'mozFillRule', 'webkitFillRule'].forEach(function (name) {
|
||||
if (name in ctx) ctx[name] = 'evenodd';
|
||||
});
|
||||
ctx.fill();
|
||||
|
||||
if ('mozFillRule' in ctx) {
|
||||
ctx.mozFillRule = 'evenodd';
|
||||
ctx.fill();
|
||||
} else {
|
||||
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