@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
|
@@ -11194,31 +11194,53 @@ function applyWarpAwareSelectionBorders(selection) {
|
|
|
11194
11194
|
const n = (a % 360 + 360) % 360;
|
|
11195
11195
|
return n > 180 ? n - 360 : n;
|
|
11196
11196
|
};
|
|
11197
|
-
const
|
|
11198
|
-
|
|
11197
|
+
const angleDelta = (a, b) => Math.abs(norm(a - b));
|
|
11198
|
+
const selectionMatrix = selection.calcTransformMatrix();
|
|
11199
|
+
const worldMatrices = kids.map((k) => fabric__namespace.util.multiplyTransformMatrices(
|
|
11200
|
+
selectionMatrix,
|
|
11201
|
+
k.calcOwnMatrix()
|
|
11202
|
+
));
|
|
11203
|
+
const worldAngles = worldMatrices.map((m) => norm(fabric__namespace.util.qrDecompose(m).angle ?? 0));
|
|
11204
|
+
const first = worldAngles[0] ?? 0;
|
|
11205
|
+
const allSame = Math.abs(first) > 0.5 && worldAngles.every((a) => angleDelta(a, first) <= 0.5);
|
|
11199
11206
|
if (allSame) {
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
k.set({
|
|
11213
|
-
left: x * cos - y * sin,
|
|
11214
|
-
top: x * sin + y * cos,
|
|
11215
|
-
angle: 0
|
|
11207
|
+
const restoreKidsFromWorld = () => {
|
|
11208
|
+
const invSelection = fabric__namespace.util.invertTransform(
|
|
11209
|
+
selection.calcTransformMatrix()
|
|
11210
|
+
);
|
|
11211
|
+
kids.forEach((k, index) => {
|
|
11212
|
+
const localMatrix = fabric__namespace.util.multiplyTransformMatrices(
|
|
11213
|
+
invSelection,
|
|
11214
|
+
worldMatrices[index]
|
|
11215
|
+
);
|
|
11216
|
+
fabric__namespace.util.applyTransformToObject(k, localMatrix);
|
|
11217
|
+
k.setCoords();
|
|
11218
|
+
k.dirty = true;
|
|
11216
11219
|
});
|
|
11217
|
-
|
|
11220
|
+
};
|
|
11221
|
+
selection.set({ angle: first, scaleX: 1, scaleY: 1, skewX: 0, skewY: 0 });
|
|
11222
|
+
restoreKidsFromWorld();
|
|
11223
|
+
try {
|
|
11224
|
+
(_a2 = selection.triggerLayout) == null ? void 0 : _a2.call(selection);
|
|
11225
|
+
} catch {
|
|
11218
11226
|
}
|
|
11219
|
-
|
|
11227
|
+
restoreKidsFromWorld();
|
|
11220
11228
|
selection.setCoords();
|
|
11229
|
+
selection.dirty = true;
|
|
11221
11230
|
selection.__pixldocsAlignedAngle = first;
|
|
11231
|
+
} else {
|
|
11232
|
+
const anyRotated = worldAngles.some((a) => Math.abs(a) > 0.5);
|
|
11233
|
+
if (anyRotated) {
|
|
11234
|
+
try {
|
|
11235
|
+
selection.setControlsVisibility({
|
|
11236
|
+
ml: false,
|
|
11237
|
+
mr: false,
|
|
11238
|
+
mt: false,
|
|
11239
|
+
mb: false
|
|
11240
|
+
});
|
|
11241
|
+
} catch {
|
|
11242
|
+
}
|
|
11243
|
+
}
|
|
11222
11244
|
}
|
|
11223
11245
|
}
|
|
11224
11246
|
}
|
|
@@ -24267,9 +24289,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24267
24289
|
}
|
|
24268
24290
|
return svgString;
|
|
24269
24291
|
}
|
|
24270
|
-
const resolvedPackageVersion = "0.5.
|
|
24292
|
+
const resolvedPackageVersion = "0.5.314";
|
|
24271
24293
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24272
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24294
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.314";
|
|
24273
24295
|
const roundParityValue = (value) => {
|
|
24274
24296
|
if (typeof value !== "number") return value;
|
|
24275
24297
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25083,7 +25105,7 @@ class PixldocsRenderer {
|
|
|
25083
25105
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25084
25106
|
}
|
|
25085
25107
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25086
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
25108
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CkSLQ4vT.cjs"));
|
|
25087
25109
|
const prepared = preparePagesForExport(
|
|
25088
25110
|
cloned.pages,
|
|
25089
25111
|
canvasWidth,
|
|
@@ -27403,7 +27425,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27403
27425
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27404
27426
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27405
27427
|
try {
|
|
27406
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
27428
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CkSLQ4vT.cjs"));
|
|
27407
27429
|
try {
|
|
27408
27430
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27409
27431
|
} catch {
|
|
@@ -27800,4 +27822,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
27800
27822
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
27801
27823
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
27802
27824
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
27803
|
-
//# sourceMappingURL=index-
|
|
27825
|
+
//# sourceMappingURL=index-CivzkA4l.cjs.map
|