@pixldocs/canvas-renderer 0.5.312 → 0.5.313
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-P103UWW3.js → index-D8s0AmMC.js} +34 -25
- package/dist/index-D8s0AmMC.js.map +1 -0
- package/dist/{index-BVdt88VI.cjs → index-DaZy0Hz3.cjs} +34 -25
- package/dist/{index-P103UWW3.js.map → index-DaZy0Hz3.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-D5wEVDWm.js → vectorPdfExport-BPFpKueR.js} +4 -4
- package/dist/{vectorPdfExport-D5wEVDWm.js.map → vectorPdfExport-BPFpKueR.js.map} +1 -1
- package/dist/{vectorPdfExport-WWb68zM6.cjs → vectorPdfExport-BdNT5NW8.cjs} +4 -4
- package/dist/{vectorPdfExport-WWb68zM6.cjs.map → vectorPdfExport-BdNT5NW8.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BVdt88VI.cjs.map +0 -1
|
@@ -11176,30 +11176,39 @@ function applyWarpAwareSelectionBorders(selection) {
|
|
|
11176
11176
|
const n = (a % 360 + 360) % 360;
|
|
11177
11177
|
return n > 180 ? n - 360 : n;
|
|
11178
11178
|
};
|
|
11179
|
-
const
|
|
11180
|
-
|
|
11179
|
+
const angleDelta = (a, b) => Math.abs(norm(a - b));
|
|
11180
|
+
const selectionMatrix = selection.calcTransformMatrix();
|
|
11181
|
+
const worldMatrices = kids.map((k) => fabric.util.multiplyTransformMatrices(
|
|
11182
|
+
selectionMatrix,
|
|
11183
|
+
k.calcOwnMatrix()
|
|
11184
|
+
));
|
|
11185
|
+
const worldAngles = worldMatrices.map((m) => norm(fabric.util.qrDecompose(m).angle ?? 0));
|
|
11186
|
+
const first = worldAngles[0] ?? 0;
|
|
11187
|
+
const allSame = Math.abs(first) > 0.5 && worldAngles.every((a) => angleDelta(a, first) <= 0.5);
|
|
11181
11188
|
if (allSame) {
|
|
11182
|
-
|
|
11183
|
-
|
|
11184
|
-
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
k.set({
|
|
11195
|
-
left: x * cos - y * sin,
|
|
11196
|
-
top: x * sin + y * cos,
|
|
11197
|
-
angle: 0
|
|
11189
|
+
const restoreKidsFromWorld = () => {
|
|
11190
|
+
const invSelection = fabric.util.invertTransform(
|
|
11191
|
+
selection.calcTransformMatrix()
|
|
11192
|
+
);
|
|
11193
|
+
kids.forEach((k, index) => {
|
|
11194
|
+
const localMatrix = fabric.util.multiplyTransformMatrices(
|
|
11195
|
+
invSelection,
|
|
11196
|
+
worldMatrices[index]
|
|
11197
|
+
);
|
|
11198
|
+
fabric.util.applyTransformToObject(k, localMatrix);
|
|
11199
|
+
k.setCoords();
|
|
11200
|
+
k.dirty = true;
|
|
11198
11201
|
});
|
|
11199
|
-
|
|
11202
|
+
};
|
|
11203
|
+
selection.set({ angle: first, scaleX: 1, scaleY: 1, skewX: 0, skewY: 0 });
|
|
11204
|
+
restoreKidsFromWorld();
|
|
11205
|
+
try {
|
|
11206
|
+
(_a2 = selection.triggerLayout) == null ? void 0 : _a2.call(selection);
|
|
11207
|
+
} catch {
|
|
11200
11208
|
}
|
|
11201
|
-
|
|
11209
|
+
restoreKidsFromWorld();
|
|
11202
11210
|
selection.setCoords();
|
|
11211
|
+
selection.dirty = true;
|
|
11203
11212
|
selection.__pixldocsAlignedAngle = first;
|
|
11204
11213
|
}
|
|
11205
11214
|
}
|
|
@@ -24249,9 +24258,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24249
24258
|
}
|
|
24250
24259
|
return svgString;
|
|
24251
24260
|
}
|
|
24252
|
-
const resolvedPackageVersion = "0.5.
|
|
24261
|
+
const resolvedPackageVersion = "0.5.313";
|
|
24253
24262
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24254
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24263
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.313";
|
|
24255
24264
|
const roundParityValue = (value) => {
|
|
24256
24265
|
if (typeof value !== "number") return value;
|
|
24257
24266
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25065,7 +25074,7 @@ class PixldocsRenderer {
|
|
|
25065
25074
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25066
25075
|
}
|
|
25067
25076
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25068
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
25077
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BPFpKueR.js");
|
|
25069
25078
|
const prepared = preparePagesForExport(
|
|
25070
25079
|
cloned.pages,
|
|
25071
25080
|
canvasWidth,
|
|
@@ -27385,7 +27394,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27385
27394
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27386
27395
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27387
27396
|
try {
|
|
27388
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
27397
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BPFpKueR.js");
|
|
27389
27398
|
try {
|
|
27390
27399
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27391
27400
|
} catch {
|
|
@@ -27785,4 +27794,4 @@ export {
|
|
|
27785
27794
|
buildTeaserBlurFlatKeys as y,
|
|
27786
27795
|
collectFontDescriptorsFromConfig as z
|
|
27787
27796
|
};
|
|
27788
|
-
//# sourceMappingURL=index-
|
|
27797
|
+
//# sourceMappingURL=index-D8s0AmMC.js.map
|