@pixldocs/canvas-renderer 0.5.312 → 0.5.314
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-BVdt88VI.cjs → index-CivzkA4l.cjs} +47 -25
- package/dist/index-CivzkA4l.cjs.map +1 -0
- package/dist/{index-P103UWW3.js → index-Dr4Grd18.js} +47 -25
- package/dist/index-Dr4Grd18.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-WWb68zM6.cjs → vectorPdfExport-CkSLQ4vT.cjs} +4 -4
- package/dist/{vectorPdfExport-WWb68zM6.cjs.map → vectorPdfExport-CkSLQ4vT.cjs.map} +1 -1
- package/dist/{vectorPdfExport-D5wEVDWm.js → vectorPdfExport-DBoLqkEn.js} +4 -4
- package/dist/{vectorPdfExport-D5wEVDWm.js.map → vectorPdfExport-DBoLqkEn.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BVdt88VI.cjs.map +0 -1
- package/dist/index-P103UWW3.js.map +0 -1
|
@@ -11176,31 +11176,53 @@ 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;
|
|
11213
|
+
} else {
|
|
11214
|
+
const anyRotated = worldAngles.some((a) => Math.abs(a) > 0.5);
|
|
11215
|
+
if (anyRotated) {
|
|
11216
|
+
try {
|
|
11217
|
+
selection.setControlsVisibility({
|
|
11218
|
+
ml: false,
|
|
11219
|
+
mr: false,
|
|
11220
|
+
mt: false,
|
|
11221
|
+
mb: false
|
|
11222
|
+
});
|
|
11223
|
+
} catch {
|
|
11224
|
+
}
|
|
11225
|
+
}
|
|
11204
11226
|
}
|
|
11205
11227
|
}
|
|
11206
11228
|
}
|
|
@@ -24249,9 +24271,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24249
24271
|
}
|
|
24250
24272
|
return svgString;
|
|
24251
24273
|
}
|
|
24252
|
-
const resolvedPackageVersion = "0.5.
|
|
24274
|
+
const resolvedPackageVersion = "0.5.314";
|
|
24253
24275
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24254
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24276
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.314";
|
|
24255
24277
|
const roundParityValue = (value) => {
|
|
24256
24278
|
if (typeof value !== "number") return value;
|
|
24257
24279
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25065,7 +25087,7 @@ class PixldocsRenderer {
|
|
|
25065
25087
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25066
25088
|
}
|
|
25067
25089
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25068
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
25090
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DBoLqkEn.js");
|
|
25069
25091
|
const prepared = preparePagesForExport(
|
|
25070
25092
|
cloned.pages,
|
|
25071
25093
|
canvasWidth,
|
|
@@ -27385,7 +27407,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27385
27407
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27386
27408
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27387
27409
|
try {
|
|
27388
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
27410
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DBoLqkEn.js");
|
|
27389
27411
|
try {
|
|
27390
27412
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27391
27413
|
} catch {
|
|
@@ -27785,4 +27807,4 @@ export {
|
|
|
27785
27807
|
buildTeaserBlurFlatKeys as y,
|
|
27786
27808
|
collectFontDescriptorsFromConfig as z
|
|
27787
27809
|
};
|
|
27788
|
-
//# sourceMappingURL=index-
|
|
27810
|
+
//# sourceMappingURL=index-Dr4Grd18.js.map
|