@pixldocs/canvas-renderer 0.5.382 → 0.5.383
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-DJ64kXcr.js → index-BHS16lGJ.js} +5 -74
- package/dist/index-BHS16lGJ.js.map +1 -0
- package/dist/{index-BpiWTXuI.cjs → index-BOr3yt00.cjs} +5 -74
- package/dist/index-BOr3yt00.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-C6nEEZs9.js → vectorPdfExport-BegTwE0k.js} +4 -4
- package/dist/{vectorPdfExport-C6nEEZs9.js.map → vectorPdfExport-BegTwE0k.js.map} +1 -1
- package/dist/{vectorPdfExport-BI3et0Ux.cjs → vectorPdfExport-DxRLDNdM.cjs} +4 -4
- package/dist/{vectorPdfExport-BI3et0Ux.cjs.map → vectorPdfExport-DxRLDNdM.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BpiWTXuI.cjs.map +0 -1
- package/dist/index-DJ64kXcr.js.map +0 -1
|
@@ -14317,75 +14317,6 @@ 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
|
-
}
|
|
14389
14320
|
if (isXSide) {
|
|
14390
14321
|
if (child.__asLiveOrigW == null) {
|
|
14391
14322
|
child.__asLiveOrigW = (child.width ?? 0) * (child.scaleX ?? 1);
|
|
@@ -24903,9 +24834,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24903
24834
|
}
|
|
24904
24835
|
return svgString;
|
|
24905
24836
|
}
|
|
24906
|
-
const resolvedPackageVersion = "0.5.
|
|
24837
|
+
const resolvedPackageVersion = "0.5.383";
|
|
24907
24838
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24908
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24839
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.383";
|
|
24909
24840
|
const roundParityValue = (value) => {
|
|
24910
24841
|
if (typeof value !== "number") return value;
|
|
24911
24842
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25719,7 +25650,7 @@ class PixldocsRenderer {
|
|
|
25719
25650
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25720
25651
|
}
|
|
25721
25652
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25722
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
25653
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DxRLDNdM.cjs"));
|
|
25723
25654
|
const prepared = preparePagesForExport(
|
|
25724
25655
|
cloned.pages,
|
|
25725
25656
|
canvasWidth,
|
|
@@ -28039,7 +27970,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
28039
27970
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
28040
27971
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
28041
27972
|
try {
|
|
28042
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
27973
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DxRLDNdM.cjs"));
|
|
28043
27974
|
try {
|
|
28044
27975
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
28045
27976
|
} catch {
|
|
@@ -28436,4 +28367,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
28436
28367
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
28437
28368
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
28438
28369
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
28439
|
-
//# sourceMappingURL=index-
|
|
28370
|
+
//# sourceMappingURL=index-BOr3yt00.cjs.map
|