Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/embedpre.../assets/pdf/build
File: script.js
this.fontSizeScale = 1;
[11000] Fix | Delete
this.textMatrix = IDENTITY_MATRIX;
[11001] Fix | Delete
this.textMatrixScale = 1;
[11002] Fix | Delete
this.fontMatrix = FONT_IDENTITY_MATRIX;
[11003] Fix | Delete
this.leading = 0;
[11004] Fix | Delete
this.x = 0;
[11005] Fix | Delete
this.y = 0;
[11006] Fix | Delete
this.lineX = 0;
[11007] Fix | Delete
this.lineY = 0;
[11008] Fix | Delete
this.charSpacing = 0;
[11009] Fix | Delete
this.wordSpacing = 0;
[11010] Fix | Delete
this.textHScale = 1;
[11011] Fix | Delete
this.textRenderingMode = TextRenderingMode.FILL;
[11012] Fix | Delete
this.textRise = 0;
[11013] Fix | Delete
this.fillColor = "#000000";
[11014] Fix | Delete
this.strokeColor = "#000000";
[11015] Fix | Delete
this.patternFill = false;
[11016] Fix | Delete
this.fillAlpha = 1;
[11017] Fix | Delete
this.strokeAlpha = 1;
[11018] Fix | Delete
this.lineWidth = 1;
[11019] Fix | Delete
this.activeSMask = null;
[11020] Fix | Delete
this.transferMaps = "none";
[11021] Fix | Delete
this.startNewPathAndClipBox([0, 0, width, height]);
[11022] Fix | Delete
}
[11023] Fix | Delete
clone() {
[11024] Fix | Delete
const clone = Object.create(this);
[11025] Fix | Delete
clone.clipBox = this.clipBox.slice();
[11026] Fix | Delete
return clone;
[11027] Fix | Delete
}
[11028] Fix | Delete
setCurrentPoint(x, y) {
[11029] Fix | Delete
this.x = x;
[11030] Fix | Delete
this.y = y;
[11031] Fix | Delete
}
[11032] Fix | Delete
updatePathMinMax(transform, x, y) {
[11033] Fix | Delete
[x, y] = Util.applyTransform([x, y], transform);
[11034] Fix | Delete
this.minX = Math.min(this.minX, x);
[11035] Fix | Delete
this.minY = Math.min(this.minY, y);
[11036] Fix | Delete
this.maxX = Math.max(this.maxX, x);
[11037] Fix | Delete
this.maxY = Math.max(this.maxY, y);
[11038] Fix | Delete
}
[11039] Fix | Delete
updateRectMinMax(transform, rect) {
[11040] Fix | Delete
const p1 = Util.applyTransform(rect, transform);
[11041] Fix | Delete
const p2 = Util.applyTransform(rect.slice(2), transform);
[11042] Fix | Delete
const p3 = Util.applyTransform([rect[0], rect[3]], transform);
[11043] Fix | Delete
const p4 = Util.applyTransform([rect[2], rect[1]], transform);
[11044] Fix | Delete
this.minX = Math.min(this.minX, p1[0], p2[0], p3[0], p4[0]);
[11045] Fix | Delete
this.minY = Math.min(this.minY, p1[1], p2[1], p3[1], p4[1]);
[11046] Fix | Delete
this.maxX = Math.max(this.maxX, p1[0], p2[0], p3[0], p4[0]);
[11047] Fix | Delete
this.maxY = Math.max(this.maxY, p1[1], p2[1], p3[1], p4[1]);
[11048] Fix | Delete
}
[11049] Fix | Delete
updateScalingPathMinMax(transform, minMax) {
[11050] Fix | Delete
Util.scaleMinMax(transform, minMax);
[11051] Fix | Delete
this.minX = Math.min(this.minX, minMax[0]);
[11052] Fix | Delete
this.minY = Math.min(this.minY, minMax[1]);
[11053] Fix | Delete
this.maxX = Math.max(this.maxX, minMax[2]);
[11054] Fix | Delete
this.maxY = Math.max(this.maxY, minMax[3]);
[11055] Fix | Delete
}
[11056] Fix | Delete
updateCurvePathMinMax(transform, x0, y0, x1, y1, x2, y2, x3, y3, minMax) {
[11057] Fix | Delete
const box = Util.bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax);
[11058] Fix | Delete
if (minMax) {
[11059] Fix | Delete
return;
[11060] Fix | Delete
}
[11061] Fix | Delete
this.updateRectMinMax(transform, box);
[11062] Fix | Delete
}
[11063] Fix | Delete
getPathBoundingBox(pathType = PathType.FILL, transform = null) {
[11064] Fix | Delete
const box = [this.minX, this.minY, this.maxX, this.maxY];
[11065] Fix | Delete
if (pathType === PathType.STROKE) {
[11066] Fix | Delete
if (!transform) {
[11067] Fix | Delete
unreachable("Stroke bounding box must include transform.");
[11068] Fix | Delete
}
[11069] Fix | Delete
const scale = Util.singularValueDecompose2dScale(transform);
[11070] Fix | Delete
const xStrokePad = scale[0] * this.lineWidth / 2;
[11071] Fix | Delete
const yStrokePad = scale[1] * this.lineWidth / 2;
[11072] Fix | Delete
box[0] -= xStrokePad;
[11073] Fix | Delete
box[1] -= yStrokePad;
[11074] Fix | Delete
box[2] += xStrokePad;
[11075] Fix | Delete
box[3] += yStrokePad;
[11076] Fix | Delete
}
[11077] Fix | Delete
return box;
[11078] Fix | Delete
}
[11079] Fix | Delete
updateClipFromPath() {
[11080] Fix | Delete
const intersect = Util.intersect(this.clipBox, this.getPathBoundingBox());
[11081] Fix | Delete
this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]);
[11082] Fix | Delete
}
[11083] Fix | Delete
isEmptyClip() {
[11084] Fix | Delete
return this.minX === Infinity;
[11085] Fix | Delete
}
[11086] Fix | Delete
startNewPathAndClipBox(box) {
[11087] Fix | Delete
this.clipBox = box;
[11088] Fix | Delete
this.minX = Infinity;
[11089] Fix | Delete
this.minY = Infinity;
[11090] Fix | Delete
this.maxX = 0;
[11091] Fix | Delete
this.maxY = 0;
[11092] Fix | Delete
}
[11093] Fix | Delete
getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) {
[11094] Fix | Delete
return Util.intersect(this.clipBox, this.getPathBoundingBox(pathType, transform));
[11095] Fix | Delete
}
[11096] Fix | Delete
}
[11097] Fix | Delete
function putBinaryImageData(ctx, imgData) {
[11098] Fix | Delete
if (typeof ImageData !== "undefined" && imgData instanceof ImageData) {
[11099] Fix | Delete
ctx.putImageData(imgData, 0, 0);
[11100] Fix | Delete
return;
[11101] Fix | Delete
}
[11102] Fix | Delete
const height = imgData.height,
[11103] Fix | Delete
width = imgData.width;
[11104] Fix | Delete
const partialChunkHeight = height % FULL_CHUNK_HEIGHT;
[11105] Fix | Delete
const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;
[11106] Fix | Delete
const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;
[11107] Fix | Delete
const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);
[11108] Fix | Delete
let srcPos = 0,
[11109] Fix | Delete
destPos;
[11110] Fix | Delete
const src = imgData.data;
[11111] Fix | Delete
const dest = chunkImgData.data;
[11112] Fix | Delete
let i, j, thisChunkHeight, elemsInThisChunk;
[11113] Fix | Delete
if (imgData.kind === util_ImageKind.GRAYSCALE_1BPP) {
[11114] Fix | Delete
const srcLength = src.byteLength;
[11115] Fix | Delete
const dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2);
[11116] Fix | Delete
const dest32DataLength = dest32.length;
[11117] Fix | Delete
const fullSrcDiff = width + 7 >> 3;
[11118] Fix | Delete
const white = 0xffffffff;
[11119] Fix | Delete
const black = util_FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;
[11120] Fix | Delete
for (i = 0; i < totalChunks; i++) {
[11121] Fix | Delete
thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;
[11122] Fix | Delete
destPos = 0;
[11123] Fix | Delete
for (j = 0; j < thisChunkHeight; j++) {
[11124] Fix | Delete
const srcDiff = srcLength - srcPos;
[11125] Fix | Delete
let k = 0;
[11126] Fix | Delete
const kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7;
[11127] Fix | Delete
const kEndUnrolled = kEnd & ~7;
[11128] Fix | Delete
let mask = 0;
[11129] Fix | Delete
let srcByte = 0;
[11130] Fix | Delete
for (; k < kEndUnrolled; k += 8) {
[11131] Fix | Delete
srcByte = src[srcPos++];
[11132] Fix | Delete
dest32[destPos++] = srcByte & 128 ? white : black;
[11133] Fix | Delete
dest32[destPos++] = srcByte & 64 ? white : black;
[11134] Fix | Delete
dest32[destPos++] = srcByte & 32 ? white : black;
[11135] Fix | Delete
dest32[destPos++] = srcByte & 16 ? white : black;
[11136] Fix | Delete
dest32[destPos++] = srcByte & 8 ? white : black;
[11137] Fix | Delete
dest32[destPos++] = srcByte & 4 ? white : black;
[11138] Fix | Delete
dest32[destPos++] = srcByte & 2 ? white : black;
[11139] Fix | Delete
dest32[destPos++] = srcByte & 1 ? white : black;
[11140] Fix | Delete
}
[11141] Fix | Delete
for (; k < kEnd; k++) {
[11142] Fix | Delete
if (mask === 0) {
[11143] Fix | Delete
srcByte = src[srcPos++];
[11144] Fix | Delete
mask = 128;
[11145] Fix | Delete
}
[11146] Fix | Delete
dest32[destPos++] = srcByte & mask ? white : black;
[11147] Fix | Delete
mask >>= 1;
[11148] Fix | Delete
}
[11149] Fix | Delete
}
[11150] Fix | Delete
while (destPos < dest32DataLength) {
[11151] Fix | Delete
dest32[destPos++] = 0;
[11152] Fix | Delete
}
[11153] Fix | Delete
ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);
[11154] Fix | Delete
}
[11155] Fix | Delete
} else if (imgData.kind === util_ImageKind.RGBA_32BPP) {
[11156] Fix | Delete
j = 0;
[11157] Fix | Delete
elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4;
[11158] Fix | Delete
for (i = 0; i < fullChunks; i++) {
[11159] Fix | Delete
dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));
[11160] Fix | Delete
srcPos += elemsInThisChunk;
[11161] Fix | Delete
ctx.putImageData(chunkImgData, 0, j);
[11162] Fix | Delete
j += FULL_CHUNK_HEIGHT;
[11163] Fix | Delete
}
[11164] Fix | Delete
if (i < totalChunks) {
[11165] Fix | Delete
elemsInThisChunk = width * partialChunkHeight * 4;
[11166] Fix | Delete
dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));
[11167] Fix | Delete
ctx.putImageData(chunkImgData, 0, j);
[11168] Fix | Delete
}
[11169] Fix | Delete
} else if (imgData.kind === util_ImageKind.RGB_24BPP) {
[11170] Fix | Delete
thisChunkHeight = FULL_CHUNK_HEIGHT;
[11171] Fix | Delete
elemsInThisChunk = width * thisChunkHeight;
[11172] Fix | Delete
for (i = 0; i < totalChunks; i++) {
[11173] Fix | Delete
if (i >= fullChunks) {
[11174] Fix | Delete
thisChunkHeight = partialChunkHeight;
[11175] Fix | Delete
elemsInThisChunk = width * thisChunkHeight;
[11176] Fix | Delete
}
[11177] Fix | Delete
destPos = 0;
[11178] Fix | Delete
for (j = elemsInThisChunk; j--;) {
[11179] Fix | Delete
dest[destPos++] = src[srcPos++];
[11180] Fix | Delete
dest[destPos++] = src[srcPos++];
[11181] Fix | Delete
dest[destPos++] = src[srcPos++];
[11182] Fix | Delete
dest[destPos++] = 255;
[11183] Fix | Delete
}
[11184] Fix | Delete
ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);
[11185] Fix | Delete
}
[11186] Fix | Delete
} else {
[11187] Fix | Delete
throw new Error(`bad image kind: ${imgData.kind}`);
[11188] Fix | Delete
}
[11189] Fix | Delete
}
[11190] Fix | Delete
function putBinaryImageMask(ctx, imgData) {
[11191] Fix | Delete
if (imgData.bitmap) {
[11192] Fix | Delete
ctx.drawImage(imgData.bitmap, 0, 0);
[11193] Fix | Delete
return;
[11194] Fix | Delete
}
[11195] Fix | Delete
const height = imgData.height,
[11196] Fix | Delete
width = imgData.width;
[11197] Fix | Delete
const partialChunkHeight = height % FULL_CHUNK_HEIGHT;
[11198] Fix | Delete
const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;
[11199] Fix | Delete
const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;
[11200] Fix | Delete
const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);
[11201] Fix | Delete
let srcPos = 0;
[11202] Fix | Delete
const src = imgData.data;
[11203] Fix | Delete
const dest = chunkImgData.data;
[11204] Fix | Delete
for (let i = 0; i < totalChunks; i++) {
[11205] Fix | Delete
const thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;
[11206] Fix | Delete
({
[11207] Fix | Delete
srcPos
[11208] Fix | Delete
} = convertBlackAndWhiteToRGBA({
[11209] Fix | Delete
src,
[11210] Fix | Delete
srcPos,
[11211] Fix | Delete
dest,
[11212] Fix | Delete
width,
[11213] Fix | Delete
height: thisChunkHeight,
[11214] Fix | Delete
nonBlackColor: 0
[11215] Fix | Delete
}));
[11216] Fix | Delete
ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);
[11217] Fix | Delete
}
[11218] Fix | Delete
}
[11219] Fix | Delete
function copyCtxState(sourceCtx, destCtx) {
[11220] Fix | Delete
const properties = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"];
[11221] Fix | Delete
for (const property of properties) {
[11222] Fix | Delete
if (sourceCtx[property] !== undefined) {
[11223] Fix | Delete
destCtx[property] = sourceCtx[property];
[11224] Fix | Delete
}
[11225] Fix | Delete
}
[11226] Fix | Delete
if (sourceCtx.setLineDash !== undefined) {
[11227] Fix | Delete
destCtx.setLineDash(sourceCtx.getLineDash());
[11228] Fix | Delete
destCtx.lineDashOffset = sourceCtx.lineDashOffset;
[11229] Fix | Delete
}
[11230] Fix | Delete
}
[11231] Fix | Delete
function resetCtxToDefault(ctx) {
[11232] Fix | Delete
ctx.strokeStyle = ctx.fillStyle = "#000000";
[11233] Fix | Delete
ctx.fillRule = "nonzero";
[11234] Fix | Delete
ctx.globalAlpha = 1;
[11235] Fix | Delete
ctx.lineWidth = 1;
[11236] Fix | Delete
ctx.lineCap = "butt";
[11237] Fix | Delete
ctx.lineJoin = "miter";
[11238] Fix | Delete
ctx.miterLimit = 10;
[11239] Fix | Delete
ctx.globalCompositeOperation = "source-over";
[11240] Fix | Delete
ctx.font = "10px sans-serif";
[11241] Fix | Delete
if (ctx.setLineDash !== undefined) {
[11242] Fix | Delete
ctx.setLineDash([]);
[11243] Fix | Delete
ctx.lineDashOffset = 0;
[11244] Fix | Delete
}
[11245] Fix | Delete
if (!isNodeJS) {
[11246] Fix | Delete
const {
[11247] Fix | Delete
filter
[11248] Fix | Delete
} = ctx;
[11249] Fix | Delete
if (filter !== "none" && filter !== "") {
[11250] Fix | Delete
ctx.filter = "none";
[11251] Fix | Delete
}
[11252] Fix | Delete
}
[11253] Fix | Delete
}
[11254] Fix | Delete
function getImageSmoothingEnabled(transform, interpolate) {
[11255] Fix | Delete
if (interpolate) {
[11256] Fix | Delete
return true;
[11257] Fix | Delete
}
[11258] Fix | Delete
const scale = Util.singularValueDecompose2dScale(transform);
[11259] Fix | Delete
scale[0] = Math.fround(scale[0]);
[11260] Fix | Delete
scale[1] = Math.fround(scale[1]);
[11261] Fix | Delete
const actualScale = Math.fround((globalThis.devicePixelRatio || 1) * PixelsPerInch.PDF_TO_CSS_UNITS);
[11262] Fix | Delete
return scale[0] <= actualScale && scale[1] <= actualScale;
[11263] Fix | Delete
}
[11264] Fix | Delete
const LINE_CAP_STYLES = ["butt", "round", "square"];
[11265] Fix | Delete
const LINE_JOIN_STYLES = ["miter", "round", "bevel"];
[11266] Fix | Delete
const NORMAL_CLIP = {};
[11267] Fix | Delete
const EO_CLIP = {};
[11268] Fix | Delete
class CanvasGraphics {
[11269] Fix | Delete
constructor(canvasCtx, commonObjs, objs, canvasFactory, filterFactory, {
[11270] Fix | Delete
optionalContentConfig,
[11271] Fix | Delete
markedContentStack = null
[11272] Fix | Delete
}, annotationCanvasMap, pageColors) {
[11273] Fix | Delete
this.ctx = canvasCtx;
[11274] Fix | Delete
this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height);
[11275] Fix | Delete
this.stateStack = [];
[11276] Fix | Delete
this.pendingClip = null;
[11277] Fix | Delete
this.pendingEOFill = false;
[11278] Fix | Delete
this.res = null;
[11279] Fix | Delete
this.xobjs = null;
[11280] Fix | Delete
this.commonObjs = commonObjs;
[11281] Fix | Delete
this.objs = objs;
[11282] Fix | Delete
this.canvasFactory = canvasFactory;
[11283] Fix | Delete
this.filterFactory = filterFactory;
[11284] Fix | Delete
this.groupStack = [];
[11285] Fix | Delete
this.processingType3 = null;
[11286] Fix | Delete
this.baseTransform = null;
[11287] Fix | Delete
this.baseTransformStack = [];
[11288] Fix | Delete
this.groupLevel = 0;
[11289] Fix | Delete
this.smaskStack = [];
[11290] Fix | Delete
this.smaskCounter = 0;
[11291] Fix | Delete
this.tempSMask = null;
[11292] Fix | Delete
this.suspendedCtx = null;
[11293] Fix | Delete
this.contentVisible = true;
[11294] Fix | Delete
this.markedContentStack = markedContentStack || [];
[11295] Fix | Delete
this.optionalContentConfig = optionalContentConfig;
[11296] Fix | Delete
this.cachedCanvases = new CachedCanvases(this.canvasFactory);
[11297] Fix | Delete
this.cachedPatterns = new Map();
[11298] Fix | Delete
this.annotationCanvasMap = annotationCanvasMap;
[11299] Fix | Delete
this.viewportScale = 1;
[11300] Fix | Delete
this.outputScaleX = 1;
[11301] Fix | Delete
this.outputScaleY = 1;
[11302] Fix | Delete
this.pageColors = pageColors;
[11303] Fix | Delete
this._cachedScaleForStroking = [-1, 0];
[11304] Fix | Delete
this._cachedGetSinglePixelWidth = null;
[11305] Fix | Delete
this._cachedBitmapsMap = new Map();
[11306] Fix | Delete
}
[11307] Fix | Delete
getObject(data, fallback = null) {
[11308] Fix | Delete
if (typeof data === "string") {
[11309] Fix | Delete
return data.startsWith("g_") ? this.commonObjs.get(data) : this.objs.get(data);
[11310] Fix | Delete
}
[11311] Fix | Delete
return fallback;
[11312] Fix | Delete
}
[11313] Fix | Delete
beginDrawing({
[11314] Fix | Delete
transform,
[11315] Fix | Delete
viewport,
[11316] Fix | Delete
transparency = false,
[11317] Fix | Delete
background = null
[11318] Fix | Delete
}) {
[11319] Fix | Delete
const width = this.ctx.canvas.width;
[11320] Fix | Delete
const height = this.ctx.canvas.height;
[11321] Fix | Delete
const savedFillStyle = this.ctx.fillStyle;
[11322] Fix | Delete
this.ctx.fillStyle = background || "#ffffff";
[11323] Fix | Delete
this.ctx.fillRect(0, 0, width, height);
[11324] Fix | Delete
this.ctx.fillStyle = savedFillStyle;
[11325] Fix | Delete
if (transparency) {
[11326] Fix | Delete
const transparentCanvas = this.cachedCanvases.getCanvas("transparent", width, height);
[11327] Fix | Delete
this.compositeCtx = this.ctx;
[11328] Fix | Delete
this.transparentCanvas = transparentCanvas.canvas;
[11329] Fix | Delete
this.ctx = transparentCanvas.context;
[11330] Fix | Delete
this.ctx.save();
[11331] Fix | Delete
this.ctx.transform(...getCurrentTransform(this.compositeCtx));
[11332] Fix | Delete
}
[11333] Fix | Delete
this.ctx.save();
[11334] Fix | Delete
resetCtxToDefault(this.ctx);
[11335] Fix | Delete
if (transform) {
[11336] Fix | Delete
this.ctx.transform(...transform);
[11337] Fix | Delete
this.outputScaleX = transform[0];
[11338] Fix | Delete
this.outputScaleY = transform[0];
[11339] Fix | Delete
}
[11340] Fix | Delete
this.ctx.transform(...viewport.transform);
[11341] Fix | Delete
this.viewportScale = viewport.scale;
[11342] Fix | Delete
this.baseTransform = getCurrentTransform(this.ctx);
[11343] Fix | Delete
}
[11344] Fix | Delete
executeOperatorList(operatorList, executionStartIdx, continueCallback, stepper) {
[11345] Fix | Delete
const argsArray = operatorList.argsArray;
[11346] Fix | Delete
const fnArray = operatorList.fnArray;
[11347] Fix | Delete
let i = executionStartIdx || 0;
[11348] Fix | Delete
const argsArrayLen = argsArray.length;
[11349] Fix | Delete
if (argsArrayLen === i) {
[11350] Fix | Delete
return i;
[11351] Fix | Delete
}
[11352] Fix | Delete
const chunkOperations = argsArrayLen - i > EXECUTION_STEPS && typeof continueCallback === "function";
[11353] Fix | Delete
const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0;
[11354] Fix | Delete
let steps = 0;
[11355] Fix | Delete
const commonObjs = this.commonObjs;
[11356] Fix | Delete
const objs = this.objs;
[11357] Fix | Delete
let fnId;
[11358] Fix | Delete
while (true) {
[11359] Fix | Delete
if (stepper !== undefined && i === stepper.nextBreakPoint) {
[11360] Fix | Delete
stepper.breakIt(i, continueCallback);
[11361] Fix | Delete
return i;
[11362] Fix | Delete
}
[11363] Fix | Delete
fnId = fnArray[i];
[11364] Fix | Delete
if (fnId !== OPS.dependency) {
[11365] Fix | Delete
this[fnId].apply(this, argsArray[i]);
[11366] Fix | Delete
} else {
[11367] Fix | Delete
for (const depObjId of argsArray[i]) {
[11368] Fix | Delete
const objsPool = depObjId.startsWith("g_") ? commonObjs : objs;
[11369] Fix | Delete
if (!objsPool.has(depObjId)) {
[11370] Fix | Delete
objsPool.get(depObjId, continueCallback);
[11371] Fix | Delete
return i;
[11372] Fix | Delete
}
[11373] Fix | Delete
}
[11374] Fix | Delete
}
[11375] Fix | Delete
i++;
[11376] Fix | Delete
if (i === argsArrayLen) {
[11377] Fix | Delete
return i;
[11378] Fix | Delete
}
[11379] Fix | Delete
if (chunkOperations && ++steps > EXECUTION_STEPS) {
[11380] Fix | Delete
if (Date.now() > endTime) {
[11381] Fix | Delete
continueCallback();
[11382] Fix | Delete
return i;
[11383] Fix | Delete
}
[11384] Fix | Delete
steps = 0;
[11385] Fix | Delete
}
[11386] Fix | Delete
}
[11387] Fix | Delete
}
[11388] Fix | Delete
#restoreInitialState() {
[11389] Fix | Delete
while (this.stateStack.length || this.inSMaskMode) {
[11390] Fix | Delete
this.restore();
[11391] Fix | Delete
}
[11392] Fix | Delete
this.ctx.restore();
[11393] Fix | Delete
if (this.transparentCanvas) {
[11394] Fix | Delete
this.ctx = this.compositeCtx;
[11395] Fix | Delete
this.ctx.save();
[11396] Fix | Delete
this.ctx.setTransform(1, 0, 0, 1, 0, 0);
[11397] Fix | Delete
this.ctx.drawImage(this.transparentCanvas, 0, 0);
[11398] Fix | Delete
this.ctx.restore();
[11399] Fix | Delete
this.transparentCanvas = null;
[11400] Fix | Delete
}
[11401] Fix | Delete
}
[11402] Fix | Delete
endDrawing() {
[11403] Fix | Delete
this.#restoreInitialState();
[11404] Fix | Delete
this.cachedCanvases.clear();
[11405] Fix | Delete
this.cachedPatterns.clear();
[11406] Fix | Delete
for (const cache of this._cachedBitmapsMap.values()) {
[11407] Fix | Delete
for (const canvas of cache.values()) {
[11408] Fix | Delete
if (typeof HTMLCanvasElement !== "undefined" && canvas instanceof HTMLCanvasElement) {
[11409] Fix | Delete
canvas.width = canvas.height = 0;
[11410] Fix | Delete
}
[11411] Fix | Delete
}
[11412] Fix | Delete
cache.clear();
[11413] Fix | Delete
}
[11414] Fix | Delete
this._cachedBitmapsMap.clear();
[11415] Fix | Delete
this.#drawFilter();
[11416] Fix | Delete
}
[11417] Fix | Delete
#drawFilter() {
[11418] Fix | Delete
if (this.pageColors) {
[11419] Fix | Delete
const hcmFilterId = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background);
[11420] Fix | Delete
if (hcmFilterId !== "none") {
[11421] Fix | Delete
const savedFilter = this.ctx.filter;
[11422] Fix | Delete
this.ctx.filter = hcmFilterId;
[11423] Fix | Delete
this.ctx.drawImage(this.ctx.canvas, 0, 0);
[11424] Fix | Delete
this.ctx.filter = savedFilter;
[11425] Fix | Delete
}
[11426] Fix | Delete
}
[11427] Fix | Delete
}
[11428] Fix | Delete
_scaleImage(img, inverseTransform) {
[11429] Fix | Delete
const width = img.width;
[11430] Fix | Delete
const height = img.height;
[11431] Fix | Delete
let widthScale = Math.max(Math.hypot(inverseTransform[0], inverseTransform[1]), 1);
[11432] Fix | Delete
let heightScale = Math.max(Math.hypot(inverseTransform[2], inverseTransform[3]), 1);
[11433] Fix | Delete
let paintWidth = width,
[11434] Fix | Delete
paintHeight = height;
[11435] Fix | Delete
let tmpCanvasId = "prescale1";
[11436] Fix | Delete
let tmpCanvas, tmpCtx;
[11437] Fix | Delete
while (widthScale > 2 && paintWidth > 1 || heightScale > 2 && paintHeight > 1) {
[11438] Fix | Delete
let newWidth = paintWidth,
[11439] Fix | Delete
newHeight = paintHeight;
[11440] Fix | Delete
if (widthScale > 2 && paintWidth > 1) {
[11441] Fix | Delete
newWidth = paintWidth >= 16384 ? Math.floor(paintWidth / 2) - 1 || 1 : Math.ceil(paintWidth / 2);
[11442] Fix | Delete
widthScale /= paintWidth / newWidth;
[11443] Fix | Delete
}
[11444] Fix | Delete
if (heightScale > 2 && paintHeight > 1) {
[11445] Fix | Delete
newHeight = paintHeight >= 16384 ? Math.floor(paintHeight / 2) - 1 || 1 : Math.ceil(paintHeight) / 2;
[11446] Fix | Delete
heightScale /= paintHeight / newHeight;
[11447] Fix | Delete
}
[11448] Fix | Delete
tmpCanvas = this.cachedCanvases.getCanvas(tmpCanvasId, newWidth, newHeight);
[11449] Fix | Delete
tmpCtx = tmpCanvas.context;
[11450] Fix | Delete
tmpCtx.clearRect(0, 0, newWidth, newHeight);
[11451] Fix | Delete
tmpCtx.drawImage(img, 0, 0, paintWidth, paintHeight, 0, 0, newWidth, newHeight);
[11452] Fix | Delete
img = tmpCanvas.canvas;
[11453] Fix | Delete
paintWidth = newWidth;
[11454] Fix | Delete
paintHeight = newHeight;
[11455] Fix | Delete
tmpCanvasId = tmpCanvasId === "prescale1" ? "prescale2" : "prescale1";
[11456] Fix | Delete
}
[11457] Fix | Delete
return {
[11458] Fix | Delete
img,
[11459] Fix | Delete
paintWidth,
[11460] Fix | Delete
paintHeight
[11461] Fix | Delete
};
[11462] Fix | Delete
}
[11463] Fix | Delete
_createMaskCanvas(img) {
[11464] Fix | Delete
const ctx = this.ctx;
[11465] Fix | Delete
const {
[11466] Fix | Delete
width,
[11467] Fix | Delete
height
[11468] Fix | Delete
} = img;
[11469] Fix | Delete
const fillColor = this.current.fillColor;
[11470] Fix | Delete
const isPatternFill = this.current.patternFill;
[11471] Fix | Delete
const currentTransform = getCurrentTransform(ctx);
[11472] Fix | Delete
let cache, cacheKey, scaled, maskCanvas;
[11473] Fix | Delete
if ((img.bitmap || img.data) && img.count > 1) {
[11474] Fix | Delete
const mainKey = img.bitmap || img.data.buffer;
[11475] Fix | Delete
cacheKey = JSON.stringify(isPatternFill ? currentTransform : [currentTransform.slice(0, 4), fillColor]);
[11476] Fix | Delete
cache = this._cachedBitmapsMap.get(mainKey);
[11477] Fix | Delete
if (!cache) {
[11478] Fix | Delete
cache = new Map();
[11479] Fix | Delete
this._cachedBitmapsMap.set(mainKey, cache);
[11480] Fix | Delete
}
[11481] Fix | Delete
const cachedImage = cache.get(cacheKey);
[11482] Fix | Delete
if (cachedImage && !isPatternFill) {
[11483] Fix | Delete
const offsetX = Math.round(Math.min(currentTransform[0], currentTransform[2]) + currentTransform[4]);
[11484] Fix | Delete
const offsetY = Math.round(Math.min(currentTransform[1], currentTransform[3]) + currentTransform[5]);
[11485] Fix | Delete
return {
[11486] Fix | Delete
canvas: cachedImage,
[11487] Fix | Delete
offsetX,
[11488] Fix | Delete
offsetY
[11489] Fix | Delete
};
[11490] Fix | Delete
}
[11491] Fix | Delete
scaled = cachedImage;
[11492] Fix | Delete
}
[11493] Fix | Delete
if (!scaled) {
[11494] Fix | Delete
maskCanvas = this.cachedCanvases.getCanvas("maskCanvas", width, height);
[11495] Fix | Delete
putBinaryImageMask(maskCanvas.context, img);
[11496] Fix | Delete
}
[11497] Fix | Delete
let maskToCanvas = Util.transform(currentTransform, [1 / width, 0, 0, -1 / height, 0, 0]);
[11498] Fix | Delete
maskToCanvas = Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]);
[11499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function