@pixldocs/canvas-renderer 0.5.436 → 0.5.438

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.
@@ -14036,7 +14036,7 @@ const PageCanvas = forwardRef(
14036
14036
  };
14037
14037
  fabricCanvas.__updateDrilledGroupOutline = updateDrilledGroupOutline;
14038
14038
  fabricCanvas.on("mouse:down:before", (opt) => {
14039
- var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
14039
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
14040
14040
  const activeBeforeMouseDown = fabricCanvas.getActiveObject();
14041
14041
  if (editLockRef.current) {
14042
14042
  const active = fabricCanvas.getActiveObject();
@@ -14165,8 +14165,9 @@ const PageCanvas = forwardRef(
14165
14165
  try {
14166
14166
  const activeForCornerCheck = fabricCanvas.getActiveObject();
14167
14167
  if (activeForCornerCheck) {
14168
- const ptrForCorner = fabricCanvas.getPointer(opt.e);
14169
- const cornerHit = ((_n = activeForCornerCheck.findControl) == null ? void 0 : _n.call(activeForCornerCheck, ptrForCorner)) || ((_o = activeForCornerCheck._findTargetCorner) == null ? void 0 : _o.call(activeForCornerCheck, ptrForCorner));
14168
+ const vpPtr = ((_n = fabricCanvas.getViewportPoint) == null ? void 0 : _n.call(fabricCanvas, opt.e)) ?? fabricCanvas.getPointer(opt.e);
14169
+ const scenePtr = fabricCanvas.getPointer(opt.e);
14170
+ const cornerHit = ((_o = activeForCornerCheck.findControl) == null ? void 0 : _o.call(activeForCornerCheck, vpPtr)) || ((_p = activeForCornerCheck.findControl) == null ? void 0 : _p.call(activeForCornerCheck, scenePtr)) || ((_q = activeForCornerCheck._findTargetCorner) == null ? void 0 : _q.call(activeForCornerCheck, scenePtr));
14170
14171
  if (cornerHit) {
14171
14172
  return;
14172
14173
  }
@@ -15122,14 +15123,15 @@ const PageCanvas = forwardRef(
15122
15123
  const normalizedScaleAngle = ((obj.angle ?? 0) % 360 + 360) % 360;
15123
15124
  const isRotatedActiveSelectionCorner = obj instanceof fabric.ActiveSelection && isCornerResizeHandle(corner) && Math.min(normalizedScaleAngle, 360 - normalizedScaleAngle) > 0.5;
15124
15125
  const isRotatedActiveSelectionSide = obj instanceof fabric.ActiveSelection && (corner === "mt" || corner === "mb" || corner === "ml" || corner === "mr") && Math.min(normalizedScaleAngle, 360 - normalizedScaleAngle) > 0.5;
15125
- if (!isRotatedActiveSelectionCorner && !isRotatedActiveSelectionSide) {
15126
+ const isRotatedSingleObjectScale = !(obj instanceof fabric.ActiveSelection) && isCornerResizeHandle(corner) && Math.min(normalizedScaleAngle, 360 - normalizedScaleAngle) > 0.5;
15127
+ if (!isRotatedActiveSelectionCorner && !isRotatedActiveSelectionSide && !isRotatedSingleObjectScale) {
15126
15128
  snapDuringScaleCallback(obj, corner);
15127
15129
  }
15128
- const scaleGuides = isRotatedActiveSelectionCorner || isRotatedActiveSelectionSide ? [] : calculateScaleSnapGuidesCallback(obj, corner);
15130
+ const scaleGuides = isRotatedActiveSelectionCorner || isRotatedActiveSelectionSide || isRotatedSingleObjectScale ? [] : calculateScaleSnapGuidesCallback(obj, corner);
15129
15131
  const gridGuidesForScale = [];
15130
15132
  try {
15131
15133
  const psGrid = projectSettingsRef.current;
15132
- const canApplyGridSnap = psGrid.snapToGrid && corner && !isRotatedActiveSelectionCorner && !isRotatedActiveSelectionSide && !obj.__cropGroup && !obj.__resizeSnapHandler;
15134
+ const canApplyGridSnap = psGrid.snapToGrid && corner && !isRotatedActiveSelectionCorner && !isRotatedActiveSelectionSide && !isRotatedSingleObjectScale && !obj.__cropGroup && !obj.__resizeSnapHandler;
15133
15135
  if (canApplyGridSnap) {
15134
15136
  const gridX = psGrid.gridSizeX ?? psGrid.gridSize ?? 0;
15135
15137
  const gridY = psGrid.gridSizeY ?? psGrid.gridSize ?? 0;
@@ -25829,9 +25831,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25829
25831
  }
25830
25832
  return svgString;
25831
25833
  }
25832
- const resolvedPackageVersion = "0.5.436";
25834
+ const resolvedPackageVersion = "0.5.438";
25833
25835
  const PACKAGE_VERSION = resolvedPackageVersion;
25834
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.436";
25836
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.438";
25835
25837
  const roundParityValue = (value) => {
25836
25838
  if (typeof value !== "number") return value;
25837
25839
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26645,7 +26647,7 @@ class PixldocsRenderer {
26645
26647
  await this.waitForCanvasScene(container, cloned, i);
26646
26648
  }
26647
26649
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26648
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BoB0l9eY.js");
26650
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-ddzCO9sg.js");
26649
26651
  const prepared = preparePagesForExport(
26650
26652
  cloned.pages,
26651
26653
  canvasWidth,
@@ -28965,7 +28967,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28965
28967
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28966
28968
  sanitizeSvgTreeForPdf(svgToDraw);
28967
28969
  try {
28968
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BoB0l9eY.js");
28970
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-ddzCO9sg.js");
28969
28971
  try {
28970
28972
  await logTextMeasurementDiagnostic(svgToDraw);
28971
28973
  } catch {
@@ -29365,4 +29367,4 @@ export {
29365
29367
  buildTeaserBlurFlatKeys as y,
29366
29368
  collectFontDescriptorsFromConfig as z
29367
29369
  };
29368
- //# sourceMappingURL=index-BNFF4r0P.js.map
29370
+ //# sourceMappingURL=index-BIvYSBXQ.js.map