@pixldocs/canvas-renderer 0.5.359 → 0.5.361

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.
@@ -11105,6 +11105,136 @@ const logGroupTextResizeDebug = (phase, payload) => {
11105
11105
  console.log(GROUP_TEXT_RESIZE_DEBUG_PREFIX, phase, payload);
11106
11106
  }
11107
11107
  };
11108
+ const ROT_GROUP_IMAGE_DRIFT_DEBUG_PREFIX = "[Pixldocs][rot-group-image-drift]";
11109
+ const ROT_GROUP_IMAGE_DRIFT_DEBUG_MAX_ENTRIES = 500;
11110
+ const roundRotDriftNumber = (value) => {
11111
+ if (typeof value !== "number") return value;
11112
+ return Number.isFinite(value) ? Math.round(value * 1e3) / 1e3 : String(value);
11113
+ };
11114
+ const normalizeRotDriftPayload = (value) => {
11115
+ const seen = /* @__PURE__ */ new WeakSet();
11116
+ const normalize = (entry) => {
11117
+ if (entry == null) return entry;
11118
+ const valueType = typeof entry;
11119
+ if (valueType === "number") return roundRotDriftNumber(entry);
11120
+ if (valueType === "string" || valueType === "boolean") return entry;
11121
+ if (Array.isArray(entry)) return entry.map((item) => normalize(item));
11122
+ if (valueType === "object") {
11123
+ if (seen.has(entry)) return "[Circular]";
11124
+ seen.add(entry);
11125
+ if (entry instanceof fabric__namespace.FabricObject) return normalize(summarizeRotDriftObject(entry));
11126
+ const output = {};
11127
+ Object.entries(entry).forEach(([key, item]) => {
11128
+ output[key] = normalize(item);
11129
+ });
11130
+ return output;
11131
+ }
11132
+ return String(entry);
11133
+ };
11134
+ return normalize(value);
11135
+ };
11136
+ const matrixForRotDriftLog = (matrix) => {
11137
+ if (!matrix) return void 0;
11138
+ return matrix.map((entry) => roundRotDriftNumber(entry));
11139
+ };
11140
+ const summarizeRotDriftObject = (obj, worldMatrix) => {
11141
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
11142
+ if (!obj) return null;
11143
+ const anyObj = obj;
11144
+ try {
11145
+ const ownMatrix = (_a2 = obj.calcOwnMatrix) == null ? void 0 : _a2.call(obj);
11146
+ const calcWorld = worldMatrix ?? ((_b2 = obj.calcTransformMatrix) == null ? void 0 : _b2.call(obj));
11147
+ const decomposed = calcWorld ? fabric__namespace.util.qrDecompose(calcWorld) : null;
11148
+ const center = (_c = obj.getCenterPoint) == null ? void 0 : _c.call(obj);
11149
+ const rect = (_d = obj.getBoundingRect) == null ? void 0 : _d.call(obj);
11150
+ return {
11151
+ id: getObjectId(obj),
11152
+ type: anyObj.type ?? ((_e = obj.constructor) == null ? void 0 : _e.name),
11153
+ isAS: obj instanceof fabric__namespace.ActiveSelection,
11154
+ isGroup: obj instanceof fabric__namespace.Group,
11155
+ isImage: obj instanceof fabric__namespace.FabricImage,
11156
+ isCropGroup: Boolean(anyObj.__cropGroup || ((_f = anyObj._ct) == null ? void 0 : _f.isCropGroup)),
11157
+ hasLayoutManager: Boolean(anyObj.layoutManager),
11158
+ left: obj.left,
11159
+ top: obj.top,
11160
+ angle: obj.angle,
11161
+ scaleX: obj.scaleX,
11162
+ scaleY: obj.scaleY,
11163
+ width: obj.width,
11164
+ height: obj.height,
11165
+ originX: obj.originX,
11166
+ originY: obj.originY,
11167
+ centerX: center == null ? void 0 : center.x,
11168
+ centerY: center == null ? void 0 : center.y,
11169
+ brLeft: rect == null ? void 0 : rect.left,
11170
+ brTop: rect == null ? void 0 : rect.top,
11171
+ brWidth: rect == null ? void 0 : rect.width,
11172
+ brHeight: rect == null ? void 0 : rect.height,
11173
+ worldTx: decomposed == null ? void 0 : decomposed.translateX,
11174
+ worldTy: decomposed == null ? void 0 : decomposed.translateY,
11175
+ worldAngle: decomposed == null ? void 0 : decomposed.angle,
11176
+ worldScaleX: decomposed == null ? void 0 : decomposed.scaleX,
11177
+ worldScaleY: decomposed == null ? void 0 : decomposed.scaleY,
11178
+ ownMatrix: matrixForRotDriftLog(ownMatrix ?? null),
11179
+ worldMatrix: matrixForRotDriftLog(calcWorld ?? null),
11180
+ cropFrameW: (_g = anyObj.__cropData) == null ? void 0 : _g.frameW,
11181
+ cropFrameH: (_h = anyObj.__cropData) == null ? void 0 : _h.frameH,
11182
+ cropPanX: (_k = (_j = (_i = anyObj.__cropData) == null ? void 0 : _i._img) == null ? void 0 : _j._ct) == null ? void 0 : _k.panX,
11183
+ cropPanY: (_n = (_m = (_l = anyObj.__cropData) == null ? void 0 : _l._img) == null ? void 0 : _m._ct) == null ? void 0 : _n.panY,
11184
+ cropZoom: (_q = (_p = (_o = anyObj.__cropData) == null ? void 0 : _o._img) == null ? void 0 : _p._ct) == null ? void 0 : _q.zoom
11185
+ };
11186
+ } catch (error) {
11187
+ return { id: getObjectId(obj), type: anyObj.type, error: String(error) };
11188
+ }
11189
+ };
11190
+ const logRotGroupImageDrift = (phase, payload) => {
11191
+ if (typeof console === "undefined") return;
11192
+ try {
11193
+ const line = `${ROT_GROUP_IMAGE_DRIFT_DEBUG_PREFIX} ${phase} ${JSON.stringify(normalizeRotDriftPayload(payload))}`;
11194
+ if (typeof window !== "undefined") {
11195
+ const debugWindow = window;
11196
+ debugWindow.__pixldocsRotGroupImageDriftLogs = Array.isArray(debugWindow.__pixldocsRotGroupImageDriftLogs) ? debugWindow.__pixldocsRotGroupImageDriftLogs.slice(-ROT_GROUP_IMAGE_DRIFT_DEBUG_MAX_ENTRIES + 1) : [];
11197
+ debugWindow.__pixldocsRotGroupImageDriftLogs.push(line);
11198
+ }
11199
+ console.log(line);
11200
+ } catch {
11201
+ console.log(ROT_GROUP_IMAGE_DRIFT_DEBUG_PREFIX, phase, payload);
11202
+ }
11203
+ };
11204
+ const shouldLogRotDriftLiveTick = (target, phase) => {
11205
+ if (!target) return false;
11206
+ const anyTarget = target;
11207
+ const key = `__pixldocsRotDrift_${phase}_count`;
11208
+ const count = (anyTarget[key] ?? 0) + 1;
11209
+ anyTarget[key] = count;
11210
+ return count <= 3 || count % 8 === 0;
11211
+ };
11212
+ const logRotDriftSelectionSnapshot = (phase, target, extra = {}) => {
11213
+ if (!target) return;
11214
+ const anyTarget = target;
11215
+ const kids = typeof anyTarget.getObjects === "function" ? anyTarget.getObjects() : [];
11216
+ const selectionMatrix = target instanceof fabric__namespace.ActiveSelection ? target.calcTransformMatrix() : null;
11217
+ logRotGroupImageDrift(phase, {
11218
+ ...extra,
11219
+ target: summarizeRotDriftObject(target),
11220
+ childCount: kids.length,
11221
+ groupSelectionId: anyTarget.__pixldocsGroupSelection,
11222
+ alignedAngle: anyTarget.__pixldocsAlignedAngle
11223
+ });
11224
+ kids.forEach((kid, childIndex) => {
11225
+ var _a2, _b2;
11226
+ const childWorldMatrix = selectionMatrix ? fabric__namespace.util.multiplyTransformMatrices(
11227
+ selectionMatrix,
11228
+ kid.calcOwnMatrix()
11229
+ ) : (_a2 = kid.calcTransformMatrix) == null ? void 0 : _a2.call(kid);
11230
+ logRotGroupImageDrift(`${phase}-child`, {
11231
+ ...extra,
11232
+ childIndex,
11233
+ parentType: anyTarget.type ?? ((_b2 = target.constructor) == null ? void 0 : _b2.name),
11234
+ child: summarizeRotDriftObject(kid, childWorldMatrix ?? null)
11235
+ });
11236
+ });
11237
+ };
11108
11238
  const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
11109
11239
  const sx = Math.abs(obj.scaleX ?? 1) || 1;
11110
11240
  const sy = Math.abs(obj.scaleY ?? 1) || 1;
@@ -11214,6 +11344,7 @@ function applyWarpAwareSelectionBorders(selection) {
11214
11344
  selection.calcTransformMatrix()
11215
11345
  );
11216
11346
  kids.forEach((k, index) => {
11347
+ const beforeRestore = summarizeRotDriftObject(k);
11217
11348
  const localMatrix = fabric__namespace.util.multiplyTransformMatrices(
11218
11349
  invSelection,
11219
11350
  worldMatrices[index]
@@ -11232,8 +11363,19 @@ function applyWarpAwareSelectionBorders(selection) {
11232
11363
  }
11233
11364
  k.setCoords();
11234
11365
  k.dirty = true;
11366
+ logRotGroupImageDrift("aligned-restore-child", {
11367
+ targetAngle,
11368
+ childIndex: index,
11369
+ before: beforeRestore,
11370
+ expectedLocal: fabric__namespace.util.qrDecompose(localMatrix),
11371
+ after: summarizeRotDriftObject(k)
11372
+ });
11235
11373
  });
11236
11374
  };
11375
+ logRotDriftSelectionSnapshot("aligned-before", selection, {
11376
+ targetAngle,
11377
+ worldAngles
11378
+ });
11237
11379
  selection.set({ angle: targetAngle, scaleX: 1, scaleY: 1, skewX: 0, skewY: 0 });
11238
11380
  restoreKidsFromWorld();
11239
11381
  try {
@@ -11244,6 +11386,10 @@ function applyWarpAwareSelectionBorders(selection) {
11244
11386
  selection.setCoords();
11245
11387
  selection.dirty = true;
11246
11388
  selection.__pixldocsAlignedAngle = targetAngle;
11389
+ logRotDriftSelectionSnapshot("aligned-after", selection, {
11390
+ targetAngle,
11391
+ worldAngles
11392
+ });
11247
11393
  }
11248
11394
  }
11249
11395
  }
@@ -12291,6 +12437,10 @@ const PageCanvas = react.forwardRef(
12291
12437
  selectionLeft: rect.left,
12292
12438
  selectionTop: rect.top
12293
12439
  };
12440
+ logRotDriftSelectionSnapshot("mouse-down-active-selection", active, {
12441
+ time: Math.round(performance.now()),
12442
+ selectedStoreIds: useEditorStore.getState().canvas.selectedIds
12443
+ });
12294
12444
  }
12295
12445
  if (fabricCanvas._currentTransform) {
12296
12446
  fabricCanvas.__isUserTransforming = true;
@@ -12903,6 +13053,14 @@ const PageCanvas = react.forwardRef(
12903
13053
  groupTop: groupAbs.top,
12904
13054
  selectionAngle: ((active.angle ?? 0) % 360 + 360) % 360
12905
13055
  };
13056
+ logRotDriftSelectionSnapshot("transform-start", active, {
13057
+ time: Math.round(performance.now()),
13058
+ groupId,
13059
+ groupAbs,
13060
+ selectionRect: rect,
13061
+ transformStart: groupSelectionTransformStartRef.current,
13062
+ selectedStoreIds: useEditorStore.getState().canvas.selectedIds
13063
+ });
12906
13064
  };
12907
13065
  const restoreGroupSelectionVisualState = (selection, groupId) => {
12908
13066
  applyLogicalGroupSelectionVisualState(selection, groupId);
@@ -13689,13 +13847,22 @@ const PageCanvas = react.forwardRef(
13689
13847
  fabricCanvas.on("selection:cleared", () => {
13690
13848
  });
13691
13849
  fabricCanvas.on("object:scaling", (e) => {
13692
- var _a2, _b2, _c, _d, _e, _f;
13850
+ var _a2, _b2, _c, _d, _e, _f, _g, _h;
13693
13851
  if (!isActiveRef.current) return;
13694
13852
  const t = e.target;
13695
13853
  if (t) lastResizeScaleTargetRef.current = t;
13696
13854
  prepareGroupSelectionTransformStart(t);
13697
13855
  markTransforming(t);
13698
13856
  didTransformRef.current = true;
13857
+ if (shouldLogRotDriftLiveTick(t, "scaling")) {
13858
+ logRotDriftSelectionSnapshot("scaling", t, {
13859
+ time: Math.round(performance.now()),
13860
+ corner: t == null ? void 0 : t.__corner,
13861
+ transformAction: (_a2 = fabricCanvas._currentTransform) == null ? void 0 : _a2.action,
13862
+ transformCorner: (_b2 = fabricCanvas._currentTransform) == null ? void 0 : _b2.corner,
13863
+ transformStart: groupSelectionTransformStartRef.current
13864
+ });
13865
+ }
13699
13866
  const transformTargetId = t ? getObjectId(t) : null;
13700
13867
  if (transformTargetId && transformTargetId !== "__background__") {
13701
13868
  preserveSelectionAfterTransformIdRef.current = transformTargetId;
@@ -13856,7 +14023,7 @@ const PageCanvas = react.forwardRef(
13856
14023
  time: Math.round(performance.now()),
13857
14024
  corner,
13858
14025
  groupSelectionId: obj.__pixldocsGroupSelection,
13859
- currentTransformAction: (_a2 = fabricCanvas._currentTransform) == null ? void 0 : _a2.action,
14026
+ currentTransformAction: (_c = fabricCanvas._currentTransform) == null ? void 0 : _c.action,
13860
14027
  selection: summarizeFabricObjectForResizeDebug(obj),
13861
14028
  textChildren: obj.getObjects().filter((child) => child instanceof fabric__namespace.Textbox).map((child) => summarizeFabricObjectForResizeDebug(child))
13862
14029
  };
@@ -13866,13 +14033,13 @@ const PageCanvas = react.forwardRef(
13866
14033
  const isXSide = corner === "ml" || corner === "mr";
13867
14034
  const sAxis = isXSide ? Math.abs(obj.scaleX ?? 1) : Math.abs(obj.scaleY ?? 1);
13868
14035
  if (sAxis > 1e-3) {
13869
- if (isXSide && ((_b2 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _b2.selection) !== obj) {
14036
+ if (isXSide && ((_d = groupShiftReflowSnapshotRef.current) == null ? void 0 : _d.selection) !== obj) {
13870
14037
  groupShiftReflowSnapshotRef.current = null;
13871
14038
  const logicalGroupId = obj.__pixldocsGroupSelection;
13872
14039
  if (logicalGroupId) {
13873
14040
  try {
13874
14041
  const state = useEditorStore.getState();
13875
- const pageChildren2 = ((_c = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
14042
+ const pageChildren2 = ((_e = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
13876
14043
  const groupNode = findNodeById(pageChildren2, logicalGroupId);
13877
14044
  if (groupNode && isGroup(groupNode) && !isStackLayoutMode(groupNode.layoutMode)) {
13878
14045
  const entries = obj.getObjects().map((c) => ({
@@ -13902,7 +14069,7 @@ const PageCanvas = react.forwardRef(
13902
14069
  const asRect0 = obj.getBoundingRect();
13903
14070
  let didReflowTextChild = false;
13904
14071
  for (const child of obj.getObjects()) {
13905
- if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_d = child._ct) == null ? void 0 : _d.isCropGroup))) {
14072
+ if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_f = child._ct) == null ? void 0 : _f.isCropGroup))) {
13906
14073
  const ct = child.__cropData;
13907
14074
  if (!ct) continue;
13908
14075
  if (isXSide) {
@@ -14007,7 +14174,7 @@ const PageCanvas = react.forwardRef(
14007
14174
  didReflowTextChild = true;
14008
14175
  }
14009
14176
  }
14010
- if (isXSide && ((_e = groupShiftReflowSnapshotRef.current) == null ? void 0 : _e.selection) === obj) {
14177
+ if (isXSide && ((_g = groupShiftReflowSnapshotRef.current) == null ? void 0 : _g.selection) === obj) {
14011
14178
  const snap = groupShiftReflowSnapshotRef.current;
14012
14179
  const anchorEntry = snap.children[0];
14013
14180
  const anchorTopLive = anchorEntry.obj.top ?? 0;
@@ -14163,7 +14330,7 @@ const PageCanvas = react.forwardRef(
14163
14330
  setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
14164
14331
  if (drilledGroupIdRef.current) {
14165
14332
  try {
14166
- (_f = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _f.call(fabricCanvas);
14333
+ (_h = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _h.call(fabricCanvas);
14167
14334
  } catch {
14168
14335
  }
14169
14336
  }
@@ -14254,9 +14421,18 @@ const PageCanvas = react.forwardRef(
14254
14421
  }
14255
14422
  });
14256
14423
  fabricCanvas.on("object:rotating", (e) => {
14424
+ var _a2, _b2;
14257
14425
  markSimpleTransform(e);
14258
14426
  didTransformRef.current = true;
14259
14427
  const tr = e.target;
14428
+ if (shouldLogRotDriftLiveTick(tr, "rotating")) {
14429
+ logRotDriftSelectionSnapshot("rotating", tr, {
14430
+ time: Math.round(performance.now()),
14431
+ transformAction: (_a2 = fabricCanvas._currentTransform) == null ? void 0 : _a2.action,
14432
+ transformCorner: (_b2 = fabricCanvas._currentTransform) == null ? void 0 : _b2.corner,
14433
+ transformStart: groupSelectionTransformStartRef.current
14434
+ });
14435
+ }
14260
14436
  try {
14261
14437
  const getCursor = fabricCanvas.__pixldocsGetRotateCursor;
14262
14438
  const upper = fabricCanvas.upperCanvasEl;
@@ -14285,10 +14461,19 @@ const PageCanvas = react.forwardRef(
14285
14461
  didTransformRef.current = true;
14286
14462
  });
14287
14463
  fabricCanvas.on("object:moving", (e) => {
14464
+ var _a2, _b2;
14288
14465
  if (!isActiveRef.current) return;
14289
14466
  prepareGroupSelectionTransformStart(e.target);
14290
14467
  markTransforming(e.target);
14291
14468
  didTransformRef.current = true;
14469
+ if (shouldLogRotDriftLiveTick(e.target, "moving")) {
14470
+ logRotDriftSelectionSnapshot("moving", e.target, {
14471
+ time: Math.round(performance.now()),
14472
+ transformAction: (_a2 = fabricCanvas._currentTransform) == null ? void 0 : _a2.action,
14473
+ transformCorner: (_b2 = fabricCanvas._currentTransform) == null ? void 0 : _b2.corner,
14474
+ transformStart: groupSelectionTransformStartRef.current
14475
+ });
14476
+ }
14292
14477
  const activeDuringMove = fabricCanvas.getActiveObject();
14293
14478
  const movingLogicalGroupId = activeDuringMove instanceof fabric__namespace.ActiveSelection ? activeDuringMove.__pixldocsGroupSelection : void 0;
14294
14479
  const pendingMoveDrill = pendingGroupDrillInRef.current;
@@ -14625,6 +14810,15 @@ const PageCanvas = react.forwardRef(
14625
14810
  activeObjects = activeObjects[0].getObjects();
14626
14811
  }
14627
14812
  const isActiveSelection = activeObj instanceof fabric__namespace.ActiveSelection || activeObjects.length > 1;
14813
+ if (activeObj instanceof fabric__namespace.ActiveSelection) {
14814
+ logRotDriftSelectionSnapshot("modified-start-active-selection", activeObj, {
14815
+ time: Math.round(performance.now()),
14816
+ modifiedTarget: summarizeRotDriftObject(modifiedTarget),
14817
+ activeObjectIds: activeObjects.map((candidate) => getObjectId(candidate)),
14818
+ selectedStoreIds: useEditorStore.getState().canvas.selectedIds,
14819
+ transformStart: groupSelectionTransformStartRef.current
14820
+ });
14821
+ }
14628
14822
  const activeSelectionResizeHandle = isActiveSelection ? activeSelectionResizeHandleRef.current : null;
14629
14823
  const debugGroupTextCornerResize = activeObj instanceof fabric__namespace.ActiveSelection && isCornerResizeHandle(activeSelectionResizeHandle) && activeObjects.some((candidate) => candidate instanceof fabric__namespace.Textbox);
14630
14824
  if (debugGroupTextCornerResize) {
@@ -14902,9 +15096,8 @@ const PageCanvas = react.forwardRef(
14902
15096
  finalScaleX = 1;
14903
15097
  finalScaleY = 1;
14904
15098
  if (isActiveSelection && activeObj instanceof fabric__namespace.ActiveSelection) {
14905
- const frameBounds = getObjectFrameBoundsInSelection(activeObj, obj, sourceFrameW, sourceFrameH);
14906
- absoluteLeft = frameBounds.left;
14907
- absoluteTop = frameBounds.top;
15099
+ absoluteLeft = (decomposed.translateX ?? absoluteLeft) - finalWidth / 2;
15100
+ absoluteTop = (decomposed.translateY ?? absoluteTop) - finalHeight / 2;
14908
15101
  } else {
14909
15102
  absoluteLeft = (decomposed.translateX ?? absoluteLeft) - finalWidth / 2;
14910
15103
  absoluteTop = (decomposed.translateY ?? absoluteTop) - finalHeight / 2;
@@ -15274,6 +15467,32 @@ const PageCanvas = react.forwardRef(
15274
15467
  objectBeforeStoreWrite: summarizeFabricObjectForResizeDebug(obj)
15275
15468
  });
15276
15469
  }
15470
+ if (isActiveSelection) {
15471
+ logRotGroupImageDrift("store-update-child", {
15472
+ time: Math.round(performance.now()),
15473
+ objId,
15474
+ sourceElement: sourceElement ? {
15475
+ id: sourceElement.id,
15476
+ type: sourceElement.type,
15477
+ left: sourceElement.left,
15478
+ top: sourceElement.top,
15479
+ width: sourceElement.width,
15480
+ height: sourceElement.height,
15481
+ angle: sourceElement.angle,
15482
+ scaleX: sourceElement.scaleX,
15483
+ scaleY: sourceElement.scaleY
15484
+ } : null,
15485
+ objectBeforeStoreWrite: summarizeRotDriftObject(obj, finalAbsoluteMatrix),
15486
+ activeSelection: summarizeRotDriftObject(activeObj),
15487
+ absoluteMatrix,
15488
+ finalAbsoluteMatrix,
15489
+ decomposed,
15490
+ absoluteLeft,
15491
+ absoluteTop,
15492
+ storePos,
15493
+ elementUpdate
15494
+ });
15495
+ }
15277
15496
  updateElement(objId, elementUpdate, { recordHistory: false, skipLayoutRecalc: true });
15278
15497
  obj.setCoords();
15279
15498
  }
@@ -15304,6 +15523,19 @@ const PageCanvas = react.forwardRef(
15304
15523
  renderOnAddRemove: fabricCanvas.renderOnAddRemove
15305
15524
  });
15306
15525
  }
15526
+ logRotDriftSelectionSnapshot("before-reselect", activeObj, {
15527
+ time: Math.round(performance.now()),
15528
+ wasGroupSel,
15529
+ memberIds: membersToReselect.map((member) => getObjectId(member)),
15530
+ pendingCropBakes: pendingCropGroupFrameBakes.map((bake) => ({
15531
+ id: getObjectId(bake.obj),
15532
+ width: bake.width,
15533
+ height: bake.height,
15534
+ left: bake.left,
15535
+ top: bake.top,
15536
+ angle: bake.angle
15537
+ }))
15538
+ });
15307
15539
  const prevRenderOnAddRemove = fabricCanvas.renderOnAddRemove;
15308
15540
  fabricCanvas.renderOnAddRemove = false;
15309
15541
  skipSelectionClearOnDiscardRef.current = true;
@@ -15337,6 +15569,11 @@ const PageCanvas = react.forwardRef(
15337
15569
  if (wasGroupSel) restoreGroupSelectionVisualState(newSel, wasGroupSel);
15338
15570
  fabricCanvas.setActiveObject(newSel);
15339
15571
  newSel.setCoords();
15572
+ logRotDriftSelectionSnapshot("after-reselect", newSel, {
15573
+ time: Math.round(performance.now()),
15574
+ wasGroupSel,
15575
+ memberIds: membersToReselect.map((member) => getObjectId(member))
15576
+ });
15340
15577
  if (debugGroupTextCornerResize) {
15341
15578
  logGroupTextResizeDebug("after-reselect", {
15342
15579
  time: Math.round(performance.now()),
@@ -24395,9 +24632,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24395
24632
  }
24396
24633
  return svgString;
24397
24634
  }
24398
- const resolvedPackageVersion = "0.5.359";
24635
+ const resolvedPackageVersion = "0.5.361";
24399
24636
  const PACKAGE_VERSION = resolvedPackageVersion;
24400
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.359";
24637
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.361";
24401
24638
  const roundParityValue = (value) => {
24402
24639
  if (typeof value !== "number") return value;
24403
24640
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25211,7 +25448,7 @@ class PixldocsRenderer {
25211
25448
  await this.waitForCanvasScene(container, cloned, i);
25212
25449
  }
25213
25450
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25214
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-Cnxqr8BW.cjs"));
25451
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CTUzYtqL.cjs"));
25215
25452
  const prepared = preparePagesForExport(
25216
25453
  cloned.pages,
25217
25454
  canvasWidth,
@@ -27531,7 +27768,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27531
27768
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27532
27769
  sanitizeSvgTreeForPdf(svgToDraw);
27533
27770
  try {
27534
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-Cnxqr8BW.cjs"));
27771
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CTUzYtqL.cjs"));
27535
27772
  try {
27536
27773
  await logTextMeasurementDiagnostic(svgToDraw);
27537
27774
  } catch {
@@ -27928,4 +28165,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27928
28165
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27929
28166
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27930
28167
  exports.warmTemplateFromForm = warmTemplateFromForm;
27931
- //# sourceMappingURL=index-B8DKV_MC.cjs.map
28168
+ //# sourceMappingURL=index-CG6KfVLP.cjs.map