mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Refactor class method names.
Also move functionality to more logical place in canvas.js and jpx.js.
This commit is contained in:
parent
921c1e82a3
commit
99440ab691
15 changed files with 1554 additions and 1543 deletions
|
@ -17,16 +17,16 @@ var Pattern = (function PatternClosure() {
|
|||
Pattern.prototype = {
|
||||
// Input: current Canvas context
|
||||
// Output: the appropriate fillStyle or strokeStyle
|
||||
getPattern: function pattern_getStyle(ctx) {
|
||||
getPattern: function Pattern_getPattern(ctx) {
|
||||
error('Should not call Pattern.getStyle: ' + ctx);
|
||||
}
|
||||
};
|
||||
|
||||
Pattern.shadingFromIR = function pattern_shadingFromIR(ctx, raw) {
|
||||
Pattern.shadingFromIR = function Pattern_shadingFromIR(ctx, raw) {
|
||||
return Shadings[raw[0]].fromIR(ctx, raw);
|
||||
};
|
||||
|
||||
Pattern.parseShading = function pattern_shading(shading, matrix, xref,
|
||||
Pattern.parseShading = function Pattern_parseShading(shading, matrix, xref,
|
||||
res, ctx) {
|
||||
|
||||
var dict = isStream(shading) ? shading.dict : shading;
|
||||
|
@ -102,7 +102,7 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
|
|||
this.colorStops = colorStops;
|
||||
}
|
||||
|
||||
RadialAxial.fromIR = function radialAxialShadingGetIR(ctx, raw) {
|
||||
RadialAxial.fromIR = function RadialAxial_fromIR(ctx, raw) {
|
||||
var type = raw[1];
|
||||
var colorStops = raw[2];
|
||||
var p0 = raw[3];
|
||||
|
@ -135,7 +135,7 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
|
|||
};
|
||||
|
||||
RadialAxial.prototype = {
|
||||
getIR: function radialAxialShadingGetIR() {
|
||||
getIR: function RadialAxial_getIR() {
|
||||
var coordsArr = this.coordsArr;
|
||||
var type = this.shadingType;
|
||||
if (type == PatternType.AXIAL) {
|
||||
|
@ -170,12 +170,12 @@ Shadings.Dummy = (function DummyClosure() {
|
|||
this.type = 'Pattern';
|
||||
}
|
||||
|
||||
Dummy.fromIR = function dummyShadingFromIR() {
|
||||
Dummy.fromIR = function Dummy_fromIR() {
|
||||
return 'hotpink';
|
||||
};
|
||||
|
||||
Dummy.prototype = {
|
||||
getIR: function dummyShadingGetIR() {
|
||||
getIR: function Dummy_getIR() {
|
||||
return ['Dummy'];
|
||||
}
|
||||
};
|
||||
|
@ -264,7 +264,7 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||
this.canvas = tmpCanvas;
|
||||
}
|
||||
|
||||
TilingPattern.getIR = function tiling_getIR(operatorList, dict, args) {
|
||||
TilingPattern.getIR = function TilingPattern_getIR(operatorList, dict, args) {
|
||||
var matrix = dict.get('Matrix');
|
||||
var bbox = dict.get('BBox');
|
||||
var xstep = dict.get('XStep');
|
||||
|
@ -277,7 +277,7 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||
};
|
||||
|
||||
TilingPattern.prototype = {
|
||||
getPattern: function tiling_getPattern() {
|
||||
getPattern: function TilingPattern_getPattern() {
|
||||
var matrix = this.matrix;
|
||||
var curMatrix = this.curMatrix;
|
||||
var ctx = this.ctx;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue