@pixldocs/canvas-renderer 0.5.381 → 0.5.382
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-Cm_jngwB.cjs → index-BpiWTXuI.cjs} +75 -5
- package/dist/index-BpiWTXuI.cjs.map +1 -0
- package/dist/{index-BR48GoFH.js → index-DJ64kXcr.js} +75 -5
- package/dist/index-DJ64kXcr.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-VKrjfN4n.cjs → vectorPdfExport-BI3et0Ux.cjs} +4 -4
- package/dist/{vectorPdfExport-VKrjfN4n.cjs.map → vectorPdfExport-BI3et0Ux.cjs.map} +1 -1
- package/dist/{vectorPdfExport-OXbQZXtd.js → vectorPdfExport-C6nEEZs9.js} +4 -4
- package/dist/{vectorPdfExport-OXbQZXtd.js.map → vectorPdfExport-C6nEEZs9.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BR48GoFH.js.map +0 -1
- package/dist/index-Cm_jngwB.cjs.map +0 -1
|
@@ -14317,6 +14317,75 @@ const PageCanvas = react.forwardRef(
|
|
|
14317
14317
|
continue;
|
|
14318
14318
|
}
|
|
14319
14319
|
if (!(child instanceof fabric__namespace.Textbox)) continue;
|
|
14320
|
+
const childAngle = child.angle ?? 0;
|
|
14321
|
+
const normalizedAng = (childAngle % 180 + 180) % 180;
|
|
14322
|
+
const distFromAxis = Math.min(
|
|
14323
|
+
normalizedAng,
|
|
14324
|
+
Math.abs(normalizedAng - 90),
|
|
14325
|
+
Math.abs(normalizedAng - 180)
|
|
14326
|
+
);
|
|
14327
|
+
const isRotatedChild = distFromAxis > 0.5;
|
|
14328
|
+
if (isRotatedChild) {
|
|
14329
|
+
if (child.__asLiveRotSnap == null) {
|
|
14330
|
+
const selMatrix0 = obj.calcTransformMatrix();
|
|
14331
|
+
const localCenter0 = child.getCenterPoint();
|
|
14332
|
+
const worldCenter0 = fabric__namespace.util.transformPoint(localCenter0, selMatrix0);
|
|
14333
|
+
const origMinBoxH = Number(child.minBoxHeight);
|
|
14334
|
+
child.__asLiveRotSnap = {
|
|
14335
|
+
worldCenter: { x: worldCenter0.x, y: worldCenter0.y },
|
|
14336
|
+
worldAngle: (obj.angle ?? 0) + childAngle,
|
|
14337
|
+
origW: (child.width ?? 0) * Math.abs(child.scaleX ?? 1),
|
|
14338
|
+
origH: (child.height ?? 0) * Math.abs(child.scaleY ?? 1),
|
|
14339
|
+
origMinBoxH: Number.isFinite(origMinBoxH) ? origMinBoxH : 0
|
|
14340
|
+
};
|
|
14341
|
+
}
|
|
14342
|
+
const snap = child.__asLiveRotSnap;
|
|
14343
|
+
const θ = (snap.worldAngle - (obj.angle ?? 0)) * Math.PI / 180;
|
|
14344
|
+
const c = Math.cos(θ);
|
|
14345
|
+
const s = Math.sin(θ);
|
|
14346
|
+
const cos2 = c * c;
|
|
14347
|
+
const sin2 = s * s;
|
|
14348
|
+
if (isXSide) {
|
|
14349
|
+
const sLocal = Math.max(0.01, sin2 + sAxis * cos2);
|
|
14350
|
+
const newW = Math.max(20, snap.origW * sLocal);
|
|
14351
|
+
child._set("width", newW);
|
|
14352
|
+
} else {
|
|
14353
|
+
const sLocal = Math.max(0.01, cos2 + sAxis * sin2);
|
|
14354
|
+
const newH = Math.max(20, (snap.origMinBoxH || snap.origH) * sLocal);
|
|
14355
|
+
child.minBoxHeight = newH;
|
|
14356
|
+
}
|
|
14357
|
+
const asAngleRad = (obj.angle ?? 0) * Math.PI / 180;
|
|
14358
|
+
const ca = Math.cos(asAngleRad), sa = Math.sin(asAngleRad);
|
|
14359
|
+
const asSx = obj.scaleX || 1;
|
|
14360
|
+
const asSy = obj.scaleY || 1;
|
|
14361
|
+
const wa = snap.worldAngle * Math.PI / 180;
|
|
14362
|
+
const cw = Math.cos(wa), sw = Math.sin(wa);
|
|
14363
|
+
const i00 = ca / asSx, i01 = sa / asSx;
|
|
14364
|
+
const i10 = -sa / asSy, i11 = ca / asSy;
|
|
14365
|
+
const m00 = i00 * cw + i01 * sw;
|
|
14366
|
+
const m01 = i00 * -sw + i01 * cw;
|
|
14367
|
+
const m10 = i10 * cw + i11 * sw;
|
|
14368
|
+
const m11 = i10 * -sw + i11 * cw;
|
|
14369
|
+
const decomp = fabric__namespace.util.qrDecompose([m00, m10, m01, m11, 0, 0]);
|
|
14370
|
+
child._set("angle", decomp.angle);
|
|
14371
|
+
child._set("scaleX", decomp.scaleX);
|
|
14372
|
+
child._set("scaleY", decomp.scaleY);
|
|
14373
|
+
child._set("skewX", decomp.skewX || 0);
|
|
14374
|
+
child._set("skewY", decomp.skewY || 0);
|
|
14375
|
+
try {
|
|
14376
|
+
child.initDimensions();
|
|
14377
|
+
} catch {
|
|
14378
|
+
}
|
|
14379
|
+
const selMatrixNow = obj.calcTransformMatrix();
|
|
14380
|
+
const invSelNow = fabric__namespace.util.invertTransform(selMatrixNow);
|
|
14381
|
+
const wcPoint = new fabric__namespace.Point(snap.worldCenter.x, snap.worldCenter.y);
|
|
14382
|
+
const localCenterNow = fabric__namespace.util.transformPoint(wcPoint, invSelNow);
|
|
14383
|
+
child.setPositionByOrigin(localCenterNow, "center", "center");
|
|
14384
|
+
child.setCoords();
|
|
14385
|
+
child.dirty = true;
|
|
14386
|
+
didReflowTextChild = true;
|
|
14387
|
+
continue;
|
|
14388
|
+
}
|
|
14320
14389
|
if (isXSide) {
|
|
14321
14390
|
if (child.__asLiveOrigW == null) {
|
|
14322
14391
|
child.__asLiveOrigW = (child.width ?? 0) * (child.scaleX ?? 1);
|
|
@@ -14733,6 +14802,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14733
14802
|
for (const child of t.getObjects()) {
|
|
14734
14803
|
delete child.__asLiveOrigW;
|
|
14735
14804
|
delete child.__asLiveOrigH;
|
|
14805
|
+
delete child.__asLiveRotSnap;
|
|
14736
14806
|
}
|
|
14737
14807
|
}
|
|
14738
14808
|
} catch {
|
|
@@ -24833,9 +24903,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24833
24903
|
}
|
|
24834
24904
|
return svgString;
|
|
24835
24905
|
}
|
|
24836
|
-
const resolvedPackageVersion = "0.5.
|
|
24906
|
+
const resolvedPackageVersion = "0.5.382";
|
|
24837
24907
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24838
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24908
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.382";
|
|
24839
24909
|
const roundParityValue = (value) => {
|
|
24840
24910
|
if (typeof value !== "number") return value;
|
|
24841
24911
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25649,7 +25719,7 @@ class PixldocsRenderer {
|
|
|
25649
25719
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25650
25720
|
}
|
|
25651
25721
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25652
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
25722
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BI3et0Ux.cjs"));
|
|
25653
25723
|
const prepared = preparePagesForExport(
|
|
25654
25724
|
cloned.pages,
|
|
25655
25725
|
canvasWidth,
|
|
@@ -27969,7 +28039,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27969
28039
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27970
28040
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27971
28041
|
try {
|
|
27972
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
28042
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BI3et0Ux.cjs"));
|
|
27973
28043
|
try {
|
|
27974
28044
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27975
28045
|
} catch {
|
|
@@ -28366,4 +28436,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
28366
28436
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
28367
28437
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
28368
28438
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
28369
|
-
//# sourceMappingURL=index-
|
|
28439
|
+
//# sourceMappingURL=index-BpiWTXuI.cjs.map
|