mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
Fix inconsistent spacing and trailing commas in objects in remaining src/
files, so we can enable the comma-dangle
and object-curly-spacing
ESLint rules later on
http://eslint.org/docs/rules/comma-dangle http://eslint.org/docs/rules/object-curly-spacing Given that we currently have quite inconsistent object formatting, fixing this in *one* big patch probably wouldn't be feasible (since I cannot imagine anyone wanting to review that); hence I've opted to try and do this piecewise instead. Please note: This patch was created automatically, using the ESLint `--fix` command line option. In a couple of places this caused lines to become too long, and I've fixed those manually; please refer to the interdiff below for the only hand-edits in this patch. ```diff diff --git a/src/display/canvas.js b/src/display/canvas.js index 5739f6f2..4216b2d2 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -2071,7 +2071,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { var map = []; for (var i = 0, ii = positions.length; i < ii; i += 2) { map.push({ transform: [scaleX, 0, 0, scaleY, positions[i], - positions[i + 1]], x: 0, y: 0, w: width, h: height, }); + positions[i + 1]], x: 0, y: 0, w: width, h: height, }); } this.paintInlineImageXObjectGroup(imgData, map); }, diff --git a/src/display/svg.js b/src/display/svg.js index 9eb05dfa..2aa21482 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -458,7 +458,11 @@ SVGGraphics = (function SVGGraphicsClosure() { for (var x = 0; x < fnArrayLen; x++) { var fnId = fnArray[x]; - opList.push({ 'fnId': fnId, 'fn': REVOPS[fnId], 'args': argsArray[x], }); + opList.push({ + 'fnId': fnId, + 'fn': REVOPS[fnId], + 'args': argsArray[x], + }); } return opListToTree(opList); }, ```
This commit is contained in:
parent
593dec1bb7
commit
f20d2cd2ae
12 changed files with 144 additions and 140 deletions
|
@ -41,9 +41,9 @@ ShadingIRs.RadialAxial = {
|
|||
grad.addColorStop(c[0], c[1]);
|
||||
}
|
||||
return grad;
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
var createMeshCanvas = (function createMeshCanvasClosure() {
|
||||
|
@ -174,7 +174,7 @@ var createMeshCanvas = (function createMeshCanvasClosure() {
|
|||
offsetX: -offsetX,
|
||||
offsetY: -offsetY,
|
||||
scaleX: 1 / scaleX,
|
||||
scaleY: 1 / scaleY
|
||||
scaleY: 1 / scaleY,
|
||||
};
|
||||
|
||||
var paddedWidth = width + BORDER_SIZE * 2;
|
||||
|
@ -269,9 +269,9 @@ ShadingIRs.Mesh = {
|
|||
temporaryPatternCanvas.scaleY);
|
||||
|
||||
return ctx.createPattern(temporaryPatternCanvas.canvas, 'no-repeat');
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
ShadingIRs.Dummy = {
|
||||
|
@ -280,9 +280,9 @@ ShadingIRs.Dummy = {
|
|||
type: 'Pattern',
|
||||
getPattern: function Dummy_fromIR_getPattern() {
|
||||
return 'hotpink';
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
function getShadingPatternFromIR(raw) {
|
||||
|
@ -296,7 +296,7 @@ function getShadingPatternFromIR(raw) {
|
|||
var TilingPattern = (function TilingPatternClosure() {
|
||||
var PaintType = {
|
||||
COLORED: 1,
|
||||
UNCOLORED: 2
|
||||
UNCOLORED: 2,
|
||||
};
|
||||
|
||||
var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough
|
||||
|
@ -428,7 +428,7 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||
this.scaleToContext();
|
||||
|
||||
return ctx.createPattern(temporaryPatternCanvas, 'repeat');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return TilingPattern;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue