@pixldocs/canvas-renderer 0.5.206 → 0.5.209

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.
@@ -6968,6 +6968,18 @@ function applyTextBackground(obj, cfg) {
6968
6968
  bg.rxBR ?? 0,
6969
6969
  bg.rxBL ?? 0
6970
6970
  ) : null;
6971
+ let shearTransform = null;
6972
+ if (isShear) {
6973
+ const fs = this.fontSize || 16;
6974
+ const ep = tpAny.endpoints;
6975
+ const dL = fs * 1.5;
6976
+ const dR = fs * 0.5;
6977
+ const lY = ep && Number.isFinite(ep.leftY) ? ep.leftY : dL;
6978
+ const rY = ep && Number.isFinite(ep.rightY) ? ep.rightY : dR;
6979
+ const slope = w > 0 ? (rY - lY) / w : 0;
6980
+ const dy = (lY + rY) / 2 - h / 2;
6981
+ shearTransform = { slope, dy };
6982
+ }
6971
6983
  let bgBounds;
6972
6984
  let bgRectsForFill = null;
6973
6985
  if (ribbonD) {
@@ -6978,6 +6990,9 @@ function applyTextBackground(obj, cfg) {
6978
6990
  }
6979
6991
  if (blockShadowActive && bg.shadowAffectsBg !== false) {
6980
6992
  ctx.save();
6993
+ if (shearTransform) {
6994
+ ctx.transform(1, shearTransform.slope, 0, 1, 0, shearTransform.dy);
6995
+ }
6981
6996
  ctx.fillStyle = bg.shadowColor;
6982
6997
  for (let i = blockSteps; i >= 1; i--) {
6983
6998
  ctx.save();
@@ -7010,6 +7025,9 @@ function applyTextBackground(obj, cfg) {
7010
7025
  }
7011
7026
  if (lineShadowActive && bg.shadowAffectsBg !== false) {
7012
7027
  ctx.save();
7028
+ if (shearTransform) {
7029
+ ctx.transform(1, shearTransform.slope, 0, 1, 0, shearTransform.dy);
7030
+ }
7013
7031
  ctx.translate(extOX, extOY);
7014
7032
  ctx.strokeStyle = bg.shadowColor;
7015
7033
  ctx.lineWidth = 1;
@@ -7046,16 +7064,8 @@ function applyTextBackground(obj, cfg) {
7046
7064
  } catch {
7047
7065
  }
7048
7066
  } else {
7049
- if (isShear) {
7050
- const fs = this.fontSize || 16;
7051
- const ep = tpAny.endpoints;
7052
- const dL = fs * 1.5;
7053
- const dR = fs * 0.5;
7054
- const lY = ep && Number.isFinite(ep.leftY) ? ep.leftY : dL;
7055
- const rY = ep && Number.isFinite(ep.rightY) ? ep.rightY : dR;
7056
- const slope = w > 0 ? (rY - lY) / w : 0;
7057
- const dy = (lY + rY) / 2 - h / 2;
7058
- ctx.transform(1, slope, 0, 1, 0, dy);
7067
+ if (shearTransform) {
7068
+ ctx.transform(1, shearTransform.slope, 0, 1, 0, shearTransform.dy);
7059
7069
  }
7060
7070
  const rects = bgRectsForFill;
7061
7071
  for (const r of rects) {
@@ -10749,7 +10759,12 @@ const PageCanvas = forwardRef(
10749
10759
  top: 0,
10750
10760
  width: canvasWidth,
10751
10761
  height: canvasHeight,
10752
- absolutePositioned: true
10762
+ absolutePositioned: true,
10763
+ // Rect defaults to strokeWidth:1, which makes the clip region inset
10764
+ // by ~0.5px on top/left and bleed ~0.5px on bottom/right after the
10765
+ // viewport-transform multiply — visible as a 1px page-bg sliver
10766
+ // along the top/left edges of the canvas at any zoom level.
10767
+ strokeWidth: 0
10753
10768
  });
10754
10769
  fc.requestRenderAll();
10755
10770
  }, [canvasWidth, canvasHeight]);
@@ -18526,6 +18541,13 @@ function warpTextboxSvgAlongPath(svg, obj) {
18526
18541
  const existing = bgEl.getAttribute("transform");
18527
18542
  bgEl.setAttribute("transform", existing ? `${matrix} ${existing}` : matrix);
18528
18543
  }
18544
+ const bgShadowPaths = Array.from(doc2.querySelectorAll(
18545
+ "g.__pdBgShadowClone > path, g.__pdShadowRaster > path"
18546
+ ));
18547
+ for (const p of bgShadowPaths) {
18548
+ const existing = p.getAttribute("transform");
18549
+ p.setAttribute("transform", existing ? `${matrix} ${existing}` : matrix);
18550
+ }
18529
18551
  return new XMLSerializer().serializeToString(doc2.documentElement);
18530
18552
  }
18531
18553
  const resolved = resolveTextPath(tp, Number(obj.width) || 0, Number(obj.fontSize) || 16);
@@ -18924,9 +18946,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
18924
18946
  }
18925
18947
  return svgString;
18926
18948
  }
18927
- const resolvedPackageVersion = "0.5.206";
18949
+ const resolvedPackageVersion = "0.5.209";
18928
18950
  const PACKAGE_VERSION = resolvedPackageVersion;
18929
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.206";
18951
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.209";
18930
18952
  const roundParityValue = (value) => {
18931
18953
  if (typeof value !== "number") return value;
18932
18954
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -19605,7 +19627,7 @@ class PixldocsRenderer {
19605
19627
  await this.waitForCanvasScene(container, cloned, i);
19606
19628
  }
19607
19629
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
19608
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CyNCzRhQ.js");
19630
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-C0GsER0C.js");
19609
19631
  const prepared = preparePagesForExport(
19610
19632
  cloned.pages,
19611
19633
  canvasWidth,
@@ -21789,7 +21811,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
21789
21811
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
21790
21812
  sanitizeSvgTreeForPdf(svgToDraw);
21791
21813
  try {
21792
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CyNCzRhQ.js");
21814
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-C0GsER0C.js");
21793
21815
  try {
21794
21816
  await logTextMeasurementDiagnostic(svgToDraw);
21795
21817
  } catch {
@@ -22165,14 +22187,14 @@ export {
22165
22187
  canvasImageLoader as a6,
22166
22188
  getProxiedImageUrl as b,
22167
22189
  captureFabricCanvasSvgForPdf as c,
22168
- bakeEdgeFade as d,
22190
+ getImageProxyFetchOptions as d,
22169
22191
  isGroup as e,
22170
22192
  findNodeById as f,
22171
22193
  getCanvasForPage as g,
22172
- hasEdgeFade as h,
22194
+ buildRoundedTrianglePath as h,
22173
22195
  isElement as i,
22174
- buildRoundedTrianglePath as j,
22175
- getImageProxyFetchOptions as k,
22196
+ hasEdgeFade as j,
22197
+ bakeEdgeFade as k,
22176
22198
  getRoundedRectRadii as l,
22177
22199
  getTrianglePoints as m,
22178
22200
  normalizeShapeType as n,
@@ -22189,4 +22211,4 @@ export {
22189
22211
  buildTeaserBlurFlatKeys as y,
22190
22212
  collectFontDescriptorsFromConfig as z
22191
22213
  };
22192
- //# sourceMappingURL=index-CyxNh5Y9.js.map
22214
+ //# sourceMappingURL=index-DOIdbh-Q.js.map