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
const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox([0, 0, width, height], maskToCanvas);
[11500] Fix | Delete
const drawnWidth = Math.round(maxX - minX) || 1;
[11501] Fix | Delete
const drawnHeight = Math.round(maxY - minY) || 1;
[11502] Fix | Delete
const fillCanvas = this.cachedCanvases.getCanvas("fillCanvas", drawnWidth, drawnHeight);
[11503] Fix | Delete
const fillCtx = fillCanvas.context;
[11504] Fix | Delete
const offsetX = minX;
[11505] Fix | Delete
const offsetY = minY;
[11506] Fix | Delete
fillCtx.translate(-offsetX, -offsetY);
[11507] Fix | Delete
fillCtx.transform(...maskToCanvas);
[11508] Fix | Delete
if (!scaled) {
[11509] Fix | Delete
scaled = this._scaleImage(maskCanvas.canvas, getCurrentTransformInverse(fillCtx));
[11510] Fix | Delete
scaled = scaled.img;
[11511] Fix | Delete
if (cache && isPatternFill) {
[11512] Fix | Delete
cache.set(cacheKey, scaled);
[11513] Fix | Delete
}
[11514] Fix | Delete
}
[11515] Fix | Delete
fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(getCurrentTransform(fillCtx), img.interpolate);
[11516] Fix | Delete
drawImageAtIntegerCoords(fillCtx, scaled, 0, 0, scaled.width, scaled.height, 0, 0, width, height);
[11517] Fix | Delete
fillCtx.globalCompositeOperation = "source-in";
[11518] Fix | Delete
const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [1, 0, 0, 1, -offsetX, -offsetY]);
[11519] Fix | Delete
fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, PathType.FILL) : fillColor;
[11520] Fix | Delete
fillCtx.fillRect(0, 0, width, height);
[11521] Fix | Delete
if (cache && !isPatternFill) {
[11522] Fix | Delete
this.cachedCanvases.delete("fillCanvas");
[11523] Fix | Delete
cache.set(cacheKey, fillCanvas.canvas);
[11524] Fix | Delete
}
[11525] Fix | Delete
return {
[11526] Fix | Delete
canvas: fillCanvas.canvas,
[11527] Fix | Delete
offsetX: Math.round(offsetX),
[11528] Fix | Delete
offsetY: Math.round(offsetY)
[11529] Fix | Delete
};
[11530] Fix | Delete
}
[11531] Fix | Delete
setLineWidth(width) {
[11532] Fix | Delete
if (width !== this.current.lineWidth) {
[11533] Fix | Delete
this._cachedScaleForStroking[0] = -1;
[11534] Fix | Delete
}
[11535] Fix | Delete
this.current.lineWidth = width;
[11536] Fix | Delete
this.ctx.lineWidth = width;
[11537] Fix | Delete
}
[11538] Fix | Delete
setLineCap(style) {
[11539] Fix | Delete
this.ctx.lineCap = LINE_CAP_STYLES[style];
[11540] Fix | Delete
}
[11541] Fix | Delete
setLineJoin(style) {
[11542] Fix | Delete
this.ctx.lineJoin = LINE_JOIN_STYLES[style];
[11543] Fix | Delete
}
[11544] Fix | Delete
setMiterLimit(limit) {
[11545] Fix | Delete
this.ctx.miterLimit = limit;
[11546] Fix | Delete
}
[11547] Fix | Delete
setDash(dashArray, dashPhase) {
[11548] Fix | Delete
const ctx = this.ctx;
[11549] Fix | Delete
if (ctx.setLineDash !== undefined) {
[11550] Fix | Delete
ctx.setLineDash(dashArray);
[11551] Fix | Delete
ctx.lineDashOffset = dashPhase;
[11552] Fix | Delete
}
[11553] Fix | Delete
}
[11554] Fix | Delete
setRenderingIntent(intent) {}
[11555] Fix | Delete
setFlatness(flatness) {}
[11556] Fix | Delete
setGState(states) {
[11557] Fix | Delete
for (const [key, value] of states) {
[11558] Fix | Delete
switch (key) {
[11559] Fix | Delete
case "LW":
[11560] Fix | Delete
this.setLineWidth(value);
[11561] Fix | Delete
break;
[11562] Fix | Delete
case "LC":
[11563] Fix | Delete
this.setLineCap(value);
[11564] Fix | Delete
break;
[11565] Fix | Delete
case "LJ":
[11566] Fix | Delete
this.setLineJoin(value);
[11567] Fix | Delete
break;
[11568] Fix | Delete
case "ML":
[11569] Fix | Delete
this.setMiterLimit(value);
[11570] Fix | Delete
break;
[11571] Fix | Delete
case "D":
[11572] Fix | Delete
this.setDash(value[0], value[1]);
[11573] Fix | Delete
break;
[11574] Fix | Delete
case "RI":
[11575] Fix | Delete
this.setRenderingIntent(value);
[11576] Fix | Delete
break;
[11577] Fix | Delete
case "FL":
[11578] Fix | Delete
this.setFlatness(value);
[11579] Fix | Delete
break;
[11580] Fix | Delete
case "Font":
[11581] Fix | Delete
this.setFont(value[0], value[1]);
[11582] Fix | Delete
break;
[11583] Fix | Delete
case "CA":
[11584] Fix | Delete
this.current.strokeAlpha = value;
[11585] Fix | Delete
break;
[11586] Fix | Delete
case "ca":
[11587] Fix | Delete
this.current.fillAlpha = value;
[11588] Fix | Delete
this.ctx.globalAlpha = value;
[11589] Fix | Delete
break;
[11590] Fix | Delete
case "BM":
[11591] Fix | Delete
this.ctx.globalCompositeOperation = value;
[11592] Fix | Delete
break;
[11593] Fix | Delete
case "SMask":
[11594] Fix | Delete
this.current.activeSMask = value ? this.tempSMask : null;
[11595] Fix | Delete
this.tempSMask = null;
[11596] Fix | Delete
this.checkSMaskState();
[11597] Fix | Delete
break;
[11598] Fix | Delete
case "TR":
[11599] Fix | Delete
this.ctx.filter = this.current.transferMaps = this.filterFactory.addFilter(value);
[11600] Fix | Delete
break;
[11601] Fix | Delete
}
[11602] Fix | Delete
}
[11603] Fix | Delete
}
[11604] Fix | Delete
get inSMaskMode() {
[11605] Fix | Delete
return !!this.suspendedCtx;
[11606] Fix | Delete
}
[11607] Fix | Delete
checkSMaskState() {
[11608] Fix | Delete
const inSMaskMode = this.inSMaskMode;
[11609] Fix | Delete
if (this.current.activeSMask && !inSMaskMode) {
[11610] Fix | Delete
this.beginSMaskMode();
[11611] Fix | Delete
} else if (!this.current.activeSMask && inSMaskMode) {
[11612] Fix | Delete
this.endSMaskMode();
[11613] Fix | Delete
}
[11614] Fix | Delete
}
[11615] Fix | Delete
beginSMaskMode() {
[11616] Fix | Delete
if (this.inSMaskMode) {
[11617] Fix | Delete
throw new Error("beginSMaskMode called while already in smask mode");
[11618] Fix | Delete
}
[11619] Fix | Delete
const drawnWidth = this.ctx.canvas.width;
[11620] Fix | Delete
const drawnHeight = this.ctx.canvas.height;
[11621] Fix | Delete
const cacheId = "smaskGroupAt" + this.groupLevel;
[11622] Fix | Delete
const scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight);
[11623] Fix | Delete
this.suspendedCtx = this.ctx;
[11624] Fix | Delete
this.ctx = scratchCanvas.context;
[11625] Fix | Delete
const ctx = this.ctx;
[11626] Fix | Delete
ctx.setTransform(...getCurrentTransform(this.suspendedCtx));
[11627] Fix | Delete
copyCtxState(this.suspendedCtx, ctx);
[11628] Fix | Delete
mirrorContextOperations(ctx, this.suspendedCtx);
[11629] Fix | Delete
this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
[11630] Fix | Delete
}
[11631] Fix | Delete
endSMaskMode() {
[11632] Fix | Delete
if (!this.inSMaskMode) {
[11633] Fix | Delete
throw new Error("endSMaskMode called while not in smask mode");
[11634] Fix | Delete
}
[11635] Fix | Delete
this.ctx._removeMirroring();
[11636] Fix | Delete
copyCtxState(this.ctx, this.suspendedCtx);
[11637] Fix | Delete
this.ctx = this.suspendedCtx;
[11638] Fix | Delete
this.suspendedCtx = null;
[11639] Fix | Delete
}
[11640] Fix | Delete
compose(dirtyBox) {
[11641] Fix | Delete
if (!this.current.activeSMask) {
[11642] Fix | Delete
return;
[11643] Fix | Delete
}
[11644] Fix | Delete
if (!dirtyBox) {
[11645] Fix | Delete
dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];
[11646] Fix | Delete
} else {
[11647] Fix | Delete
dirtyBox[0] = Math.floor(dirtyBox[0]);
[11648] Fix | Delete
dirtyBox[1] = Math.floor(dirtyBox[1]);
[11649] Fix | Delete
dirtyBox[2] = Math.ceil(dirtyBox[2]);
[11650] Fix | Delete
dirtyBox[3] = Math.ceil(dirtyBox[3]);
[11651] Fix | Delete
}
[11652] Fix | Delete
const smask = this.current.activeSMask;
[11653] Fix | Delete
const suspendedCtx = this.suspendedCtx;
[11654] Fix | Delete
this.composeSMask(suspendedCtx, smask, this.ctx, dirtyBox);
[11655] Fix | Delete
this.ctx.save();
[11656] Fix | Delete
this.ctx.setTransform(1, 0, 0, 1, 0, 0);
[11657] Fix | Delete
this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);
[11658] Fix | Delete
this.ctx.restore();
[11659] Fix | Delete
}
[11660] Fix | Delete
composeSMask(ctx, smask, layerCtx, layerBox) {
[11661] Fix | Delete
const layerOffsetX = layerBox[0];
[11662] Fix | Delete
const layerOffsetY = layerBox[1];
[11663] Fix | Delete
const layerWidth = layerBox[2] - layerOffsetX;
[11664] Fix | Delete
const layerHeight = layerBox[3] - layerOffsetY;
[11665] Fix | Delete
if (layerWidth === 0 || layerHeight === 0) {
[11666] Fix | Delete
return;
[11667] Fix | Delete
}
[11668] Fix | Delete
this.genericComposeSMask(smask.context, layerCtx, layerWidth, layerHeight, smask.subtype, smask.backdrop, smask.transferMap, layerOffsetX, layerOffsetY, smask.offsetX, smask.offsetY);
[11669] Fix | Delete
ctx.save();
[11670] Fix | Delete
ctx.globalAlpha = 1;
[11671] Fix | Delete
ctx.globalCompositeOperation = "source-over";
[11672] Fix | Delete
ctx.setTransform(1, 0, 0, 1, 0, 0);
[11673] Fix | Delete
ctx.drawImage(layerCtx.canvas, 0, 0);
[11674] Fix | Delete
ctx.restore();
[11675] Fix | Delete
}
[11676] Fix | Delete
genericComposeSMask(maskCtx, layerCtx, width, height, subtype, backdrop, transferMap, layerOffsetX, layerOffsetY, maskOffsetX, maskOffsetY) {
[11677] Fix | Delete
let maskCanvas = maskCtx.canvas;
[11678] Fix | Delete
let maskX = layerOffsetX - maskOffsetX;
[11679] Fix | Delete
let maskY = layerOffsetY - maskOffsetY;
[11680] Fix | Delete
if (backdrop) {
[11681] Fix | Delete
if (maskX < 0 || maskY < 0 || maskX + width > maskCanvas.width || maskY + height > maskCanvas.height) {
[11682] Fix | Delete
const canvas = this.cachedCanvases.getCanvas("maskExtension", width, height);
[11683] Fix | Delete
const ctx = canvas.context;
[11684] Fix | Delete
ctx.drawImage(maskCanvas, -maskX, -maskY);
[11685] Fix | Delete
if (backdrop.some(c => c !== 0)) {
[11686] Fix | Delete
ctx.globalCompositeOperation = "destination-atop";
[11687] Fix | Delete
ctx.fillStyle = Util.makeHexColor(...backdrop);
[11688] Fix | Delete
ctx.fillRect(0, 0, width, height);
[11689] Fix | Delete
ctx.globalCompositeOperation = "source-over";
[11690] Fix | Delete
}
[11691] Fix | Delete
maskCanvas = canvas.canvas;
[11692] Fix | Delete
maskX = maskY = 0;
[11693] Fix | Delete
} else if (backdrop.some(c => c !== 0)) {
[11694] Fix | Delete
maskCtx.save();
[11695] Fix | Delete
maskCtx.globalAlpha = 1;
[11696] Fix | Delete
maskCtx.setTransform(1, 0, 0, 1, 0, 0);
[11697] Fix | Delete
const clip = new Path2D();
[11698] Fix | Delete
clip.rect(maskX, maskY, width, height);
[11699] Fix | Delete
maskCtx.clip(clip);
[11700] Fix | Delete
maskCtx.globalCompositeOperation = "destination-atop";
[11701] Fix | Delete
maskCtx.fillStyle = Util.makeHexColor(...backdrop);
[11702] Fix | Delete
maskCtx.fillRect(maskX, maskY, width, height);
[11703] Fix | Delete
maskCtx.restore();
[11704] Fix | Delete
}
[11705] Fix | Delete
}
[11706] Fix | Delete
layerCtx.save();
[11707] Fix | Delete
layerCtx.globalAlpha = 1;
[11708] Fix | Delete
layerCtx.setTransform(1, 0, 0, 1, 0, 0);
[11709] Fix | Delete
if (subtype === "Alpha" && transferMap) {
[11710] Fix | Delete
layerCtx.filter = this.filterFactory.addAlphaFilter(transferMap);
[11711] Fix | Delete
} else if (subtype === "Luminosity") {
[11712] Fix | Delete
layerCtx.filter = this.filterFactory.addLuminosityFilter(transferMap);
[11713] Fix | Delete
}
[11714] Fix | Delete
const clip = new Path2D();
[11715] Fix | Delete
clip.rect(layerOffsetX, layerOffsetY, width, height);
[11716] Fix | Delete
layerCtx.clip(clip);
[11717] Fix | Delete
layerCtx.globalCompositeOperation = "destination-in";
[11718] Fix | Delete
layerCtx.drawImage(maskCanvas, maskX, maskY, width, height, layerOffsetX, layerOffsetY, width, height);
[11719] Fix | Delete
layerCtx.restore();
[11720] Fix | Delete
}
[11721] Fix | Delete
save() {
[11722] Fix | Delete
if (this.inSMaskMode) {
[11723] Fix | Delete
copyCtxState(this.ctx, this.suspendedCtx);
[11724] Fix | Delete
this.suspendedCtx.save();
[11725] Fix | Delete
} else {
[11726] Fix | Delete
this.ctx.save();
[11727] Fix | Delete
}
[11728] Fix | Delete
const old = this.current;
[11729] Fix | Delete
this.stateStack.push(old);
[11730] Fix | Delete
this.current = old.clone();
[11731] Fix | Delete
}
[11732] Fix | Delete
restore() {
[11733] Fix | Delete
if (this.stateStack.length === 0 && this.inSMaskMode) {
[11734] Fix | Delete
this.endSMaskMode();
[11735] Fix | Delete
}
[11736] Fix | Delete
if (this.stateStack.length !== 0) {
[11737] Fix | Delete
this.current = this.stateStack.pop();
[11738] Fix | Delete
if (this.inSMaskMode) {
[11739] Fix | Delete
this.suspendedCtx.restore();
[11740] Fix | Delete
copyCtxState(this.suspendedCtx, this.ctx);
[11741] Fix | Delete
} else {
[11742] Fix | Delete
this.ctx.restore();
[11743] Fix | Delete
}
[11744] Fix | Delete
this.checkSMaskState();
[11745] Fix | Delete
this.pendingClip = null;
[11746] Fix | Delete
this._cachedScaleForStroking[0] = -1;
[11747] Fix | Delete
this._cachedGetSinglePixelWidth = null;
[11748] Fix | Delete
}
[11749] Fix | Delete
}
[11750] Fix | Delete
transform(a, b, c, d, e, f) {
[11751] Fix | Delete
this.ctx.transform(a, b, c, d, e, f);
[11752] Fix | Delete
this._cachedScaleForStroking[0] = -1;
[11753] Fix | Delete
this._cachedGetSinglePixelWidth = null;
[11754] Fix | Delete
}
[11755] Fix | Delete
constructPath(ops, args, minMax) {
[11756] Fix | Delete
const ctx = this.ctx;
[11757] Fix | Delete
const current = this.current;
[11758] Fix | Delete
let x = current.x,
[11759] Fix | Delete
y = current.y;
[11760] Fix | Delete
let startX, startY;
[11761] Fix | Delete
const currentTransform = getCurrentTransform(ctx);
[11762] Fix | Delete
const isScalingMatrix = currentTransform[0] === 0 && currentTransform[3] === 0 || currentTransform[1] === 0 && currentTransform[2] === 0;
[11763] Fix | Delete
const minMaxForBezier = isScalingMatrix ? minMax.slice(0) : null;
[11764] Fix | Delete
for (let i = 0, j = 0, ii = ops.length; i < ii; i++) {
[11765] Fix | Delete
switch (ops[i] | 0) {
[11766] Fix | Delete
case OPS.rectangle:
[11767] Fix | Delete
x = args[j++];
[11768] Fix | Delete
y = args[j++];
[11769] Fix | Delete
const width = args[j++];
[11770] Fix | Delete
const height = args[j++];
[11771] Fix | Delete
const xw = x + width;
[11772] Fix | Delete
const yh = y + height;
[11773] Fix | Delete
ctx.moveTo(x, y);
[11774] Fix | Delete
if (width === 0 || height === 0) {
[11775] Fix | Delete
ctx.lineTo(xw, yh);
[11776] Fix | Delete
} else {
[11777] Fix | Delete
ctx.lineTo(xw, y);
[11778] Fix | Delete
ctx.lineTo(xw, yh);
[11779] Fix | Delete
ctx.lineTo(x, yh);
[11780] Fix | Delete
}
[11781] Fix | Delete
if (!isScalingMatrix) {
[11782] Fix | Delete
current.updateRectMinMax(currentTransform, [x, y, xw, yh]);
[11783] Fix | Delete
}
[11784] Fix | Delete
ctx.closePath();
[11785] Fix | Delete
break;
[11786] Fix | Delete
case OPS.moveTo:
[11787] Fix | Delete
x = args[j++];
[11788] Fix | Delete
y = args[j++];
[11789] Fix | Delete
ctx.moveTo(x, y);
[11790] Fix | Delete
if (!isScalingMatrix) {
[11791] Fix | Delete
current.updatePathMinMax(currentTransform, x, y);
[11792] Fix | Delete
}
[11793] Fix | Delete
break;
[11794] Fix | Delete
case OPS.lineTo:
[11795] Fix | Delete
x = args[j++];
[11796] Fix | Delete
y = args[j++];
[11797] Fix | Delete
ctx.lineTo(x, y);
[11798] Fix | Delete
if (!isScalingMatrix) {
[11799] Fix | Delete
current.updatePathMinMax(currentTransform, x, y);
[11800] Fix | Delete
}
[11801] Fix | Delete
break;
[11802] Fix | Delete
case OPS.curveTo:
[11803] Fix | Delete
startX = x;
[11804] Fix | Delete
startY = y;
[11805] Fix | Delete
x = args[j + 4];
[11806] Fix | Delete
y = args[j + 5];
[11807] Fix | Delete
ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], x, y);
[11808] Fix | Delete
current.updateCurvePathMinMax(currentTransform, startX, startY, args[j], args[j + 1], args[j + 2], args[j + 3], x, y, minMaxForBezier);
[11809] Fix | Delete
j += 6;
[11810] Fix | Delete
break;
[11811] Fix | Delete
case OPS.curveTo2:
[11812] Fix | Delete
startX = x;
[11813] Fix | Delete
startY = y;
[11814] Fix | Delete
ctx.bezierCurveTo(x, y, args[j], args[j + 1], args[j + 2], args[j + 3]);
[11815] Fix | Delete
current.updateCurvePathMinMax(currentTransform, startX, startY, x, y, args[j], args[j + 1], args[j + 2], args[j + 3], minMaxForBezier);
[11816] Fix | Delete
x = args[j + 2];
[11817] Fix | Delete
y = args[j + 3];
[11818] Fix | Delete
j += 4;
[11819] Fix | Delete
break;
[11820] Fix | Delete
case OPS.curveTo3:
[11821] Fix | Delete
startX = x;
[11822] Fix | Delete
startY = y;
[11823] Fix | Delete
x = args[j + 2];
[11824] Fix | Delete
y = args[j + 3];
[11825] Fix | Delete
ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y);
[11826] Fix | Delete
current.updateCurvePathMinMax(currentTransform, startX, startY, args[j], args[j + 1], x, y, x, y, minMaxForBezier);
[11827] Fix | Delete
j += 4;
[11828] Fix | Delete
break;
[11829] Fix | Delete
case OPS.closePath:
[11830] Fix | Delete
ctx.closePath();
[11831] Fix | Delete
break;
[11832] Fix | Delete
}
[11833] Fix | Delete
}
[11834] Fix | Delete
if (isScalingMatrix) {
[11835] Fix | Delete
current.updateScalingPathMinMax(currentTransform, minMaxForBezier);
[11836] Fix | Delete
}
[11837] Fix | Delete
current.setCurrentPoint(x, y);
[11838] Fix | Delete
}
[11839] Fix | Delete
closePath() {
[11840] Fix | Delete
this.ctx.closePath();
[11841] Fix | Delete
}
[11842] Fix | Delete
stroke(consumePath = true) {
[11843] Fix | Delete
const ctx = this.ctx;
[11844] Fix | Delete
const strokeColor = this.current.strokeColor;
[11845] Fix | Delete
ctx.globalAlpha = this.current.strokeAlpha;
[11846] Fix | Delete
if (this.contentVisible) {
[11847] Fix | Delete
if (typeof strokeColor === "object" && strokeColor?.getPattern) {
[11848] Fix | Delete
ctx.save();
[11849] Fix | Delete
ctx.strokeStyle = strokeColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.STROKE);
[11850] Fix | Delete
this.rescaleAndStroke(false);
[11851] Fix | Delete
ctx.restore();
[11852] Fix | Delete
} else {
[11853] Fix | Delete
this.rescaleAndStroke(true);
[11854] Fix | Delete
}
[11855] Fix | Delete
}
[11856] Fix | Delete
if (consumePath) {
[11857] Fix | Delete
this.consumePath(this.current.getClippedPathBoundingBox());
[11858] Fix | Delete
}
[11859] Fix | Delete
ctx.globalAlpha = this.current.fillAlpha;
[11860] Fix | Delete
}
[11861] Fix | Delete
closeStroke() {
[11862] Fix | Delete
this.closePath();
[11863] Fix | Delete
this.stroke();
[11864] Fix | Delete
}
[11865] Fix | Delete
fill(consumePath = true) {
[11866] Fix | Delete
const ctx = this.ctx;
[11867] Fix | Delete
const fillColor = this.current.fillColor;
[11868] Fix | Delete
const isPatternFill = this.current.patternFill;
[11869] Fix | Delete
let needRestore = false;
[11870] Fix | Delete
if (isPatternFill) {
[11871] Fix | Delete
ctx.save();
[11872] Fix | Delete
ctx.fillStyle = fillColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.FILL);
[11873] Fix | Delete
needRestore = true;
[11874] Fix | Delete
}
[11875] Fix | Delete
const intersect = this.current.getClippedPathBoundingBox();
[11876] Fix | Delete
if (this.contentVisible && intersect !== null) {
[11877] Fix | Delete
if (this.pendingEOFill) {
[11878] Fix | Delete
ctx.fill("evenodd");
[11879] Fix | Delete
this.pendingEOFill = false;
[11880] Fix | Delete
} else {
[11881] Fix | Delete
ctx.fill();
[11882] Fix | Delete
}
[11883] Fix | Delete
}
[11884] Fix | Delete
if (needRestore) {
[11885] Fix | Delete
ctx.restore();
[11886] Fix | Delete
}
[11887] Fix | Delete
if (consumePath) {
[11888] Fix | Delete
this.consumePath(intersect);
[11889] Fix | Delete
}
[11890] Fix | Delete
}
[11891] Fix | Delete
eoFill() {
[11892] Fix | Delete
this.pendingEOFill = true;
[11893] Fix | Delete
this.fill();
[11894] Fix | Delete
}
[11895] Fix | Delete
fillStroke() {
[11896] Fix | Delete
this.fill(false);
[11897] Fix | Delete
this.stroke(false);
[11898] Fix | Delete
this.consumePath();
[11899] Fix | Delete
}
[11900] Fix | Delete
eoFillStroke() {
[11901] Fix | Delete
this.pendingEOFill = true;
[11902] Fix | Delete
this.fillStroke();
[11903] Fix | Delete
}
[11904] Fix | Delete
closeFillStroke() {
[11905] Fix | Delete
this.closePath();
[11906] Fix | Delete
this.fillStroke();
[11907] Fix | Delete
}
[11908] Fix | Delete
closeEOFillStroke() {
[11909] Fix | Delete
this.pendingEOFill = true;
[11910] Fix | Delete
this.closePath();
[11911] Fix | Delete
this.fillStroke();
[11912] Fix | Delete
}
[11913] Fix | Delete
endPath() {
[11914] Fix | Delete
this.consumePath();
[11915] Fix | Delete
}
[11916] Fix | Delete
clip() {
[11917] Fix | Delete
this.pendingClip = NORMAL_CLIP;
[11918] Fix | Delete
}
[11919] Fix | Delete
eoClip() {
[11920] Fix | Delete
this.pendingClip = EO_CLIP;
[11921] Fix | Delete
}
[11922] Fix | Delete
beginText() {
[11923] Fix | Delete
this.current.textMatrix = IDENTITY_MATRIX;
[11924] Fix | Delete
this.current.textMatrixScale = 1;
[11925] Fix | Delete
this.current.x = this.current.lineX = 0;
[11926] Fix | Delete
this.current.y = this.current.lineY = 0;
[11927] Fix | Delete
}
[11928] Fix | Delete
endText() {
[11929] Fix | Delete
const paths = this.pendingTextPaths;
[11930] Fix | Delete
const ctx = this.ctx;
[11931] Fix | Delete
if (paths === undefined) {
[11932] Fix | Delete
ctx.beginPath();
[11933] Fix | Delete
return;
[11934] Fix | Delete
}
[11935] Fix | Delete
ctx.save();
[11936] Fix | Delete
ctx.beginPath();
[11937] Fix | Delete
for (const path of paths) {
[11938] Fix | Delete
ctx.setTransform(...path.transform);
[11939] Fix | Delete
ctx.translate(path.x, path.y);
[11940] Fix | Delete
path.addToPath(ctx, path.fontSize);
[11941] Fix | Delete
}
[11942] Fix | Delete
ctx.restore();
[11943] Fix | Delete
ctx.clip();
[11944] Fix | Delete
ctx.beginPath();
[11945] Fix | Delete
delete this.pendingTextPaths;
[11946] Fix | Delete
}
[11947] Fix | Delete
setCharSpacing(spacing) {
[11948] Fix | Delete
this.current.charSpacing = spacing;
[11949] Fix | Delete
}
[11950] Fix | Delete
setWordSpacing(spacing) {
[11951] Fix | Delete
this.current.wordSpacing = spacing;
[11952] Fix | Delete
}
[11953] Fix | Delete
setHScale(scale) {
[11954] Fix | Delete
this.current.textHScale = scale / 100;
[11955] Fix | Delete
}
[11956] Fix | Delete
setLeading(leading) {
[11957] Fix | Delete
this.current.leading = -leading;
[11958] Fix | Delete
}
[11959] Fix | Delete
setFont(fontRefName, size) {
[11960] Fix | Delete
const fontObj = this.commonObjs.get(fontRefName);
[11961] Fix | Delete
const current = this.current;
[11962] Fix | Delete
if (!fontObj) {
[11963] Fix | Delete
throw new Error(`Can't find font for ${fontRefName}`);
[11964] Fix | Delete
}
[11965] Fix | Delete
current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX;
[11966] Fix | Delete
if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) {
[11967] Fix | Delete
warn("Invalid font matrix for font " + fontRefName);
[11968] Fix | Delete
}
[11969] Fix | Delete
if (size < 0) {
[11970] Fix | Delete
size = -size;
[11971] Fix | Delete
current.fontDirection = -1;
[11972] Fix | Delete
} else {
[11973] Fix | Delete
current.fontDirection = 1;
[11974] Fix | Delete
}
[11975] Fix | Delete
this.current.font = fontObj;
[11976] Fix | Delete
this.current.fontSize = size;
[11977] Fix | Delete
if (fontObj.isType3Font) {
[11978] Fix | Delete
return;
[11979] Fix | Delete
}
[11980] Fix | Delete
const name = fontObj.loadedName || "sans-serif";
[11981] Fix | Delete
const typeface = fontObj.systemFontInfo?.css || `"${name}", ${fontObj.fallbackName}`;
[11982] Fix | Delete
let bold = "normal";
[11983] Fix | Delete
if (fontObj.black) {
[11984] Fix | Delete
bold = "900";
[11985] Fix | Delete
} else if (fontObj.bold) {
[11986] Fix | Delete
bold = "bold";
[11987] Fix | Delete
}
[11988] Fix | Delete
const italic = fontObj.italic ? "italic" : "normal";
[11989] Fix | Delete
let browserFontSize = size;
[11990] Fix | Delete
if (size < MIN_FONT_SIZE) {
[11991] Fix | Delete
browserFontSize = MIN_FONT_SIZE;
[11992] Fix | Delete
} else if (size > MAX_FONT_SIZE) {
[11993] Fix | Delete
browserFontSize = MAX_FONT_SIZE;
[11994] Fix | Delete
}
[11995] Fix | Delete
this.current.fontSizeScale = size / browserFontSize;
[11996] Fix | Delete
this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`;
[11997] Fix | Delete
}
[11998] Fix | Delete
setTextRenderingMode(mode) {
[11999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function