mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 01:35:43 +02:00
Normalize blend mode names.
This commit is contained in:
parent
c5199d0814
commit
4969b2ad97
5 changed files with 134 additions and 17 deletions
|
@ -950,20 +950,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
this.ctx.globalAlpha = state[1];
|
||||
break;
|
||||
case 'BM':
|
||||
if (value && value.name && (value.name !== 'Normal')) {
|
||||
var mode = value.name.replace(/([A-Z])/g,
|
||||
function(c) {
|
||||
return '-' + c.toLowerCase();
|
||||
}
|
||||
).substring(1);
|
||||
this.ctx.globalCompositeOperation = mode;
|
||||
if (this.ctx.globalCompositeOperation !== mode) {
|
||||
warn('globalCompositeOperation "' + mode +
|
||||
'" is not supported');
|
||||
}
|
||||
} else {
|
||||
this.ctx.globalCompositeOperation = 'source-over';
|
||||
}
|
||||
this.ctx.globalCompositeOperation = value;
|
||||
break;
|
||||
case 'SMask':
|
||||
if (this.current.activeSMask) {
|
||||
|
@ -1010,7 +997,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
copyCtxState(currentCtx, groupCtx);
|
||||
this.ctx = groupCtx;
|
||||
this.setGState([
|
||||
['BM', 'Normal'],
|
||||
['BM', 'source-over'],
|
||||
['ca', 1],
|
||||
['CA', 1]
|
||||
]);
|
||||
|
@ -1885,7 +1872,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
copyCtxState(currentCtx, groupCtx);
|
||||
this.ctx = groupCtx;
|
||||
this.setGState([
|
||||
['BM', 'Normal'],
|
||||
['BM', 'source-over'],
|
||||
['ca', 1],
|
||||
['CA', 1]
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue