@mhamz.01/easyflow-whiteboard 2.2.0 → 2.3.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelection.d.ts","sourceRoot":"","sources":["../../src/hooks/useSelection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAQ,YAAY,EAAe,MAAM,QAAQ,CAAC;AAMjE,UAAU,iBAAiB;IACzB,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,eAAe,EAAE,CAAC,GAAG,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1F,wBAAwB,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;IAC5D,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,YAAY,GAAI,wFAM1B,iBAAiB,
|
|
1
|
+
{"version":3,"file":"useSelection.d.ts","sourceRoot":"","sources":["../../src/hooks/useSelection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAQ,YAAY,EAAe,MAAM,QAAQ,CAAC;AAMjE,UAAU,iBAAiB;IACzB,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,eAAe,EAAE,CAAC,GAAG,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1F,wBAAwB,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;IAC5D,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,YAAY,GAAI,wFAM1B,iBAAiB,SAsJnB,CAAC"}
|
|
@@ -23,8 +23,6 @@ export const useSelection = ({ fabricCanvas, activeTool, setSelectionBox, setSel
|
|
|
23
23
|
if (activeToolRef.current !== "select" || e.target)
|
|
24
24
|
return;
|
|
25
25
|
isSelecting = true;
|
|
26
|
-
// Hide Fabric's native rubber-band rect — we draw our own
|
|
27
|
-
canvas.selection = false;
|
|
28
26
|
const p = canvas.getScenePoint(e.e);
|
|
29
27
|
selStart = { x: p.x, y: p.y };
|
|
30
28
|
selRect = new Rect({
|
|
@@ -32,11 +30,12 @@ export const useSelection = ({ fabricCanvas, activeTool, setSelectionBox, setSel
|
|
|
32
30
|
top: p.y,
|
|
33
31
|
width: 0,
|
|
34
32
|
height: 0,
|
|
35
|
-
fill: "
|
|
36
|
-
stroke: "
|
|
37
|
-
strokeWidth:
|
|
33
|
+
fill: "transparent",
|
|
34
|
+
stroke: "transparent",
|
|
35
|
+
strokeWidth: 0,
|
|
38
36
|
selectable: false,
|
|
39
37
|
evented: false,
|
|
38
|
+
visible: false, // ← hidden, pure coordinate tracker
|
|
40
39
|
excludeFromExport: true,
|
|
41
40
|
});
|
|
42
41
|
canvas.add(selRect);
|
|
@@ -56,7 +55,7 @@ export const useSelection = ({ fabricCanvas, activeTool, setSelectionBox, setSel
|
|
|
56
55
|
top: h < 0 ? p.y : selStart.y,
|
|
57
56
|
width: Math.abs(w),
|
|
58
57
|
height: Math.abs(h),
|
|
59
|
-
strokeWidth
|
|
58
|
+
// strokeWidth line removed
|
|
60
59
|
});
|
|
61
60
|
selRect.setCoords();
|
|
62
61
|
canvas.renderAll();
|
|
@@ -85,8 +84,6 @@ export const useSelection = ({ fabricCanvas, activeTool, setSelectionBox, setSel
|
|
|
85
84
|
canvas.renderAll();
|
|
86
85
|
selRect = null;
|
|
87
86
|
}
|
|
88
|
-
// Restore Fabric's native selection for object clicking
|
|
89
|
-
canvas.selection = true;
|
|
90
87
|
isSelecting = false;
|
|
91
88
|
setTimeout(() => setSelectionBox(null), 150);
|
|
92
89
|
};
|
|
@@ -135,7 +132,6 @@ export const useSelection = ({ fabricCanvas, activeTool, setSelectionBox, setSel
|
|
|
135
132
|
if (selRect) {
|
|
136
133
|
canvas.remove(selRect);
|
|
137
134
|
}
|
|
138
|
-
canvas.selection = true; // always restore on cleanup
|
|
139
135
|
};
|
|
140
136
|
// ── Stable deps only — effect registers once per canvas mount ──
|
|
141
137
|
}, [fabricCanvas, setSelectionBox, setSelectedCanvasObjects, setSelectedObjectType, setActiveTool, isDrawingRef]);
|