@pixldocs/canvas-renderer 0.5.361 → 0.5.363
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-CG6KfVLP.cjs → index-2dvR-r9n.cjs} +14 -37
- package/dist/{index-CG6KfVLP.cjs.map → index-2dvR-r9n.cjs.map} +1 -1
- package/dist/{index-BaiH8RTh.js → index-Cw161PRH.js} +14 -37
- package/dist/{index-BaiH8RTh.js.map → index-Cw161PRH.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-CTUzYtqL.cjs → vectorPdfExport-DcTlFDUW.cjs} +4 -4
- package/dist/{vectorPdfExport-CTUzYtqL.cjs.map → vectorPdfExport-DcTlFDUW.cjs.map} +1 -1
- package/dist/{vectorPdfExport-BvYAPUvD.js → vectorPdfExport-DtI5z_ZO.js} +4 -4
- package/dist/{vectorPdfExport-BvYAPUvD.js.map → vectorPdfExport-DtI5z_ZO.js.map} +1 -1
- package/package.json +1 -1
|
@@ -15214,22 +15214,8 @@ const PageCanvas = react.forwardRef(
|
|
|
15214
15214
|
finalScaleX = 1;
|
|
15215
15215
|
finalScaleY = 1;
|
|
15216
15216
|
try {
|
|
15217
|
-
|
|
15218
|
-
|
|
15219
|
-
const sin = Math.sin(angleRad);
|
|
15220
|
-
const hw = finalWidth / 2;
|
|
15221
|
-
const hh = finalHeight / 2;
|
|
15222
|
-
const corners = [
|
|
15223
|
-
{ x: -hw, y: -hh },
|
|
15224
|
-
{ x: hw, y: -hh },
|
|
15225
|
-
{ x: hw, y: hh },
|
|
15226
|
-
{ x: -hw, y: hh }
|
|
15227
|
-
].map((p) => ({
|
|
15228
|
-
x: decomposed.translateX + p.x * cos - p.y * sin,
|
|
15229
|
-
y: decomposed.translateY + p.x * sin + p.y * cos
|
|
15230
|
-
}));
|
|
15231
|
-
absoluteLeft = Math.min(...corners.map((p) => p.x));
|
|
15232
|
-
absoluteTop = Math.min(...corners.map((p) => p.y));
|
|
15217
|
+
absoluteLeft = (decomposed.translateX ?? absoluteLeft) - finalWidth / 2;
|
|
15218
|
+
absoluteTop = (decomposed.translateY ?? absoluteTop) - finalHeight / 2;
|
|
15233
15219
|
} catch {
|
|
15234
15220
|
}
|
|
15235
15221
|
finalAbsoluteMatrix = fabric__namespace.util.composeMatrix({
|
|
@@ -15338,22 +15324,13 @@ const PageCanvas = react.forwardRef(
|
|
|
15338
15324
|
} catch {
|
|
15339
15325
|
}
|
|
15340
15326
|
try {
|
|
15341
|
-
const
|
|
15342
|
-
const
|
|
15343
|
-
const
|
|
15344
|
-
const
|
|
15345
|
-
const
|
|
15346
|
-
|
|
15347
|
-
|
|
15348
|
-
{ x: hw, y: -hh },
|
|
15349
|
-
{ x: hw, y: hh },
|
|
15350
|
-
{ x: -hw, y: hh }
|
|
15351
|
-
].map((p) => ({
|
|
15352
|
-
x: decomposed.translateX + p.x * cos - p.y * sin,
|
|
15353
|
-
y: decomposed.translateY + p.x * sin + p.y * cos
|
|
15354
|
-
}));
|
|
15355
|
-
absoluteLeft = Math.min(...corners.map((p) => p.x));
|
|
15356
|
-
absoluteTop = Math.min(...corners.map((p) => p.y));
|
|
15327
|
+
const textCenterX = decomposed.translateX ?? absoluteLeft;
|
|
15328
|
+
const textCenterY = decomposed.translateY ?? absoluteTop;
|
|
15329
|
+
const theta = fabric__namespace.util.degreesToRadians(decomposed.angle ?? 0);
|
|
15330
|
+
const cos = Math.cos(theta);
|
|
15331
|
+
const sin = Math.sin(theta);
|
|
15332
|
+
absoluteLeft = textCenterX - (cos * finalWidth / 2 - sin * finalHeight / 2);
|
|
15333
|
+
absoluteTop = textCenterY - (sin * finalWidth / 2 + cos * finalHeight / 2);
|
|
15357
15334
|
} catch {
|
|
15358
15335
|
}
|
|
15359
15336
|
finalAbsoluteMatrix = fabric__namespace.util.composeMatrix({
|
|
@@ -24632,9 +24609,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24632
24609
|
}
|
|
24633
24610
|
return svgString;
|
|
24634
24611
|
}
|
|
24635
|
-
const resolvedPackageVersion = "0.5.
|
|
24612
|
+
const resolvedPackageVersion = "0.5.363";
|
|
24636
24613
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24637
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24614
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.363";
|
|
24638
24615
|
const roundParityValue = (value) => {
|
|
24639
24616
|
if (typeof value !== "number") return value;
|
|
24640
24617
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25448,7 +25425,7 @@ class PixldocsRenderer {
|
|
|
25448
25425
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25449
25426
|
}
|
|
25450
25427
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25451
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
25428
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DcTlFDUW.cjs"));
|
|
25452
25429
|
const prepared = preparePagesForExport(
|
|
25453
25430
|
cloned.pages,
|
|
25454
25431
|
canvasWidth,
|
|
@@ -27768,7 +27745,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27768
27745
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27769
27746
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27770
27747
|
try {
|
|
27771
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
27748
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DcTlFDUW.cjs"));
|
|
27772
27749
|
try {
|
|
27773
27750
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27774
27751
|
} catch {
|
|
@@ -28165,4 +28142,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
28165
28142
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
28166
28143
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
28167
28144
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
28168
|
-
//# sourceMappingURL=index-
|
|
28145
|
+
//# sourceMappingURL=index-2dvR-r9n.cjs.map
|