@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
|
@@ -15196,22 +15196,8 @@ const PageCanvas = forwardRef(
|
|
|
15196
15196
|
finalScaleX = 1;
|
|
15197
15197
|
finalScaleY = 1;
|
|
15198
15198
|
try {
|
|
15199
|
-
|
|
15200
|
-
|
|
15201
|
-
const sin = Math.sin(angleRad);
|
|
15202
|
-
const hw = finalWidth / 2;
|
|
15203
|
-
const hh = finalHeight / 2;
|
|
15204
|
-
const corners = [
|
|
15205
|
-
{ x: -hw, y: -hh },
|
|
15206
|
-
{ x: hw, y: -hh },
|
|
15207
|
-
{ x: hw, y: hh },
|
|
15208
|
-
{ x: -hw, y: hh }
|
|
15209
|
-
].map((p) => ({
|
|
15210
|
-
x: decomposed.translateX + p.x * cos - p.y * sin,
|
|
15211
|
-
y: decomposed.translateY + p.x * sin + p.y * cos
|
|
15212
|
-
}));
|
|
15213
|
-
absoluteLeft = Math.min(...corners.map((p) => p.x));
|
|
15214
|
-
absoluteTop = Math.min(...corners.map((p) => p.y));
|
|
15199
|
+
absoluteLeft = (decomposed.translateX ?? absoluteLeft) - finalWidth / 2;
|
|
15200
|
+
absoluteTop = (decomposed.translateY ?? absoluteTop) - finalHeight / 2;
|
|
15215
15201
|
} catch {
|
|
15216
15202
|
}
|
|
15217
15203
|
finalAbsoluteMatrix = fabric.util.composeMatrix({
|
|
@@ -15320,22 +15306,13 @@ const PageCanvas = forwardRef(
|
|
|
15320
15306
|
} catch {
|
|
15321
15307
|
}
|
|
15322
15308
|
try {
|
|
15323
|
-
const
|
|
15324
|
-
const
|
|
15325
|
-
const
|
|
15326
|
-
const
|
|
15327
|
-
const
|
|
15328
|
-
|
|
15329
|
-
|
|
15330
|
-
{ x: hw, y: -hh },
|
|
15331
|
-
{ x: hw, y: hh },
|
|
15332
|
-
{ x: -hw, y: hh }
|
|
15333
|
-
].map((p) => ({
|
|
15334
|
-
x: decomposed.translateX + p.x * cos - p.y * sin,
|
|
15335
|
-
y: decomposed.translateY + p.x * sin + p.y * cos
|
|
15336
|
-
}));
|
|
15337
|
-
absoluteLeft = Math.min(...corners.map((p) => p.x));
|
|
15338
|
-
absoluteTop = Math.min(...corners.map((p) => p.y));
|
|
15309
|
+
const textCenterX = decomposed.translateX ?? absoluteLeft;
|
|
15310
|
+
const textCenterY = decomposed.translateY ?? absoluteTop;
|
|
15311
|
+
const theta = fabric.util.degreesToRadians(decomposed.angle ?? 0);
|
|
15312
|
+
const cos = Math.cos(theta);
|
|
15313
|
+
const sin = Math.sin(theta);
|
|
15314
|
+
absoluteLeft = textCenterX - (cos * finalWidth / 2 - sin * finalHeight / 2);
|
|
15315
|
+
absoluteTop = textCenterY - (sin * finalWidth / 2 + cos * finalHeight / 2);
|
|
15339
15316
|
} catch {
|
|
15340
15317
|
}
|
|
15341
15318
|
finalAbsoluteMatrix = fabric.util.composeMatrix({
|
|
@@ -24614,9 +24591,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24614
24591
|
}
|
|
24615
24592
|
return svgString;
|
|
24616
24593
|
}
|
|
24617
|
-
const resolvedPackageVersion = "0.5.
|
|
24594
|
+
const resolvedPackageVersion = "0.5.363";
|
|
24618
24595
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24619
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24596
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.363";
|
|
24620
24597
|
const roundParityValue = (value) => {
|
|
24621
24598
|
if (typeof value !== "number") return value;
|
|
24622
24599
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25430,7 +25407,7 @@ class PixldocsRenderer {
|
|
|
25430
25407
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25431
25408
|
}
|
|
25432
25409
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25433
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
25410
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DtI5z_ZO.js");
|
|
25434
25411
|
const prepared = preparePagesForExport(
|
|
25435
25412
|
cloned.pages,
|
|
25436
25413
|
canvasWidth,
|
|
@@ -27750,7 +27727,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27750
27727
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27751
27728
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27752
27729
|
try {
|
|
27753
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
27730
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DtI5z_ZO.js");
|
|
27754
27731
|
try {
|
|
27755
27732
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27756
27733
|
} catch {
|
|
@@ -28150,4 +28127,4 @@ export {
|
|
|
28150
28127
|
buildTeaserBlurFlatKeys as y,
|
|
28151
28128
|
collectFontDescriptorsFromConfig as z
|
|
28152
28129
|
};
|
|
28153
|
-
//# sourceMappingURL=index-
|
|
28130
|
+
//# sourceMappingURL=index-Cw161PRH.js.map
|