@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.
@@ -14299,75 +14299,6 @@ const PageCanvas = forwardRef(
14299
14299
  continue;
14300
14300
  }
14301
14301
  if (!(child instanceof fabric.Textbox)) continue;
14302
- const childAngle = child.angle ?? 0;
14303
- const normalizedAng = (childAngle % 180 + 180) % 180;
14304
- const distFromAxis = Math.min(
14305
- normalizedAng,
14306
- Math.abs(normalizedAng - 90),
14307
- Math.abs(normalizedAng - 180)
14308
- );
14309
- const isRotatedChild = distFromAxis > 0.5;
14310
- if (isRotatedChild) {
14311
- if (child.__asLiveRotSnap == null) {
14312
- const selMatrix0 = obj.calcTransformMatrix();
14313
- const localCenter0 = child.getCenterPoint();
14314
- const worldCenter0 = fabric.util.transformPoint(localCenter0, selMatrix0);
14315
- const origMinBoxH = Number(child.minBoxHeight);
14316
- child.__asLiveRotSnap = {
14317
- worldCenter: { x: worldCenter0.x, y: worldCenter0.y },
14318
- worldAngle: (obj.angle ?? 0) + childAngle,
14319
- origW: (child.width ?? 0) * Math.abs(child.scaleX ?? 1),
14320
- origH: (child.height ?? 0) * Math.abs(child.scaleY ?? 1),
14321
- origMinBoxH: Number.isFinite(origMinBoxH) ? origMinBoxH : 0
14322
- };
14323
- }
14324
- const snap = child.__asLiveRotSnap;
14325
- const θ = (snap.worldAngle - (obj.angle ?? 0)) * Math.PI / 180;
14326
- const c = Math.cos(θ);
14327
- const s = Math.sin(θ);
14328
- const cos2 = c * c;
14329
- const sin2 = s * s;
14330
- if (isXSide) {
14331
- const sLocal = Math.max(0.01, sin2 + sAxis * cos2);
14332
- const newW = Math.max(20, snap.origW * sLocal);
14333
- child._set("width", newW);
14334
- } else {
14335
- const sLocal = Math.max(0.01, cos2 + sAxis * sin2);
14336
- const newH = Math.max(20, (snap.origMinBoxH || snap.origH) * sLocal);
14337
- child.minBoxHeight = newH;
14338
- }
14339
- const asAngleRad = (obj.angle ?? 0) * Math.PI / 180;
14340
- const ca = Math.cos(asAngleRad), sa = Math.sin(asAngleRad);
14341
- const asSx = obj.scaleX || 1;
14342
- const asSy = obj.scaleY || 1;
14343
- const wa = snap.worldAngle * Math.PI / 180;
14344
- const cw = Math.cos(wa), sw = Math.sin(wa);
14345
- const i00 = ca / asSx, i01 = sa / asSx;
14346
- const i10 = -sa / asSy, i11 = ca / asSy;
14347
- const m00 = i00 * cw + i01 * sw;
14348
- const m01 = i00 * -sw + i01 * cw;
14349
- const m10 = i10 * cw + i11 * sw;
14350
- const m11 = i10 * -sw + i11 * cw;
14351
- const decomp = fabric.util.qrDecompose([m00, m10, m01, m11, 0, 0]);
14352
- child._set("angle", decomp.angle);
14353
- child._set("scaleX", decomp.scaleX);
14354
- child._set("scaleY", decomp.scaleY);
14355
- child._set("skewX", decomp.skewX || 0);
14356
- child._set("skewY", decomp.skewY || 0);
14357
- try {
14358
- child.initDimensions();
14359
- } catch {
14360
- }
14361
- const selMatrixNow = obj.calcTransformMatrix();
14362
- const invSelNow = fabric.util.invertTransform(selMatrixNow);
14363
- const wcPoint = new fabric.Point(snap.worldCenter.x, snap.worldCenter.y);
14364
- const localCenterNow = fabric.util.transformPoint(wcPoint, invSelNow);
14365
- child.setPositionByOrigin(localCenterNow, "center", "center");
14366
- child.setCoords();
14367
- child.dirty = true;
14368
- didReflowTextChild = true;
14369
- continue;
14370
- }
14371
14302
  if (isXSide) {
14372
14303
  if (child.__asLiveOrigW == null) {
14373
14304
  child.__asLiveOrigW = (child.width ?? 0) * (child.scaleX ?? 1);
@@ -24885,9 +24816,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24885
24816
  }
24886
24817
  return svgString;
24887
24818
  }
24888
- const resolvedPackageVersion = "0.5.382";
24819
+ const resolvedPackageVersion = "0.5.383";
24889
24820
  const PACKAGE_VERSION = resolvedPackageVersion;
24890
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.382";
24821
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.383";
24891
24822
  const roundParityValue = (value) => {
24892
24823
  if (typeof value !== "number") return value;
24893
24824
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25701,7 +25632,7 @@ class PixldocsRenderer {
25701
25632
  await this.waitForCanvasScene(container, cloned, i);
25702
25633
  }
25703
25634
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25704
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-C6nEEZs9.js");
25635
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BegTwE0k.js");
25705
25636
  const prepared = preparePagesForExport(
25706
25637
  cloned.pages,
25707
25638
  canvasWidth,
@@ -28021,7 +27952,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28021
27952
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28022
27953
  sanitizeSvgTreeForPdf(svgToDraw);
28023
27954
  try {
28024
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-C6nEEZs9.js");
27955
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BegTwE0k.js");
28025
27956
  try {
28026
27957
  await logTextMeasurementDiagnostic(svgToDraw);
28027
27958
  } catch {
@@ -28421,4 +28352,4 @@ export {
28421
28352
  buildTeaserBlurFlatKeys as y,
28422
28353
  collectFontDescriptorsFromConfig as z
28423
28354
  };
28424
- //# sourceMappingURL=index-DJ64kXcr.js.map
28355
+ //# sourceMappingURL=index-BHS16lGJ.js.map