@mhamz.01/easyflow-whiteboard 2.78.0 → 2.79.0

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.
@@ -273,8 +273,8 @@ export default function CanvasOverlayLayer({ tasks, documents, onTasksUpdate, on
273
273
  itemIds: itemsToDrag,
274
274
  startPositions,
275
275
  canvasObjectsStartPos,
276
- offsetX: worldOffsetX, // Now stored as World Units
277
- offsetY: worldOffsetY, // Now stored as World Units
276
+ offsetX: clickWorldX, // Now stored as World Units
277
+ offsetY: clickWorldY, // Now stored as World Units
278
278
  };
279
279
  if (!selectedIds.has(itemId) && dragStateRef.current.itemIds.length === 0) {
280
280
  setSelectedIds(new Set([itemId]));
@@ -330,24 +330,24 @@ export default function CanvasOverlayLayer({ tasks, documents, onTasksUpdate, on
330
330
  const firstStart = startPositions.get(firstId);
331
331
  if (!firstStart)
332
332
  return;
333
- const deltaX = newWorldX - firstStart.x;
334
- const deltaY = newWorldY - firstStart.y;
333
+ // const deltaX = newWorldX - firstStart.x;
334
+ // const deltaY = newWorldY - firstStart.y;
335
335
  // 6. Update HTML Nodes (Batching these into one state update)
336
336
  setLocalTasks((prev) => prev.map((t) => itemIds.includes(t.id) ? {
337
337
  ...t,
338
- x: (startPositions.get(t.id)?.x ?? t.x) + deltaX,
339
- y: (startPositions.get(t.id)?.y ?? t.y) + deltaY,
338
+ x: (startPositions.get(t.id)?.x ?? t.x) + newWorldX,
339
+ y: (startPositions.get(t.id)?.y ?? t.y) + newWorldY,
340
340
  } : t));
341
341
  setLocalDocuments((prev) => prev.map((d) => itemIds.includes(d.id) ? {
342
342
  ...d,
343
- x: (startPositions.get(d.id)?.x ?? d.x) + deltaX,
344
- y: (startPositions.get(d.id)?.y ?? d.y) + deltaY,
343
+ x: (startPositions.get(d.id)?.x ?? d.x) + newWorldX,
344
+ y: (startPositions.get(d.id)?.y ?? d.y) + newWorldY,
345
345
  } : d));
346
346
  // 7. Sync Fabric Objects (Imperative update for performance)
347
347
  canvasObjectsStartPos.forEach((startPos, obj) => {
348
348
  obj.set({
349
- left: startPos.left + deltaX,
350
- top: startPos.top + deltaY,
349
+ left: startPos.left + newWorldX,
350
+ top: startPos.top + newWorldY,
351
351
  });
352
352
  obj.setCoords(); // Required for selection/intersection accuracy
353
353
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhamz.01/easyflow-whiteboard",
3
- "version": "2.78.0",
3
+ "version": "2.79.0",
4
4
  "description": "A feature-rich whiteboard component built with Fabric.js and React",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",