fix(refboard): full sync audit — batch multi-drag, persist resize, sync lock
- Batch broadcastTransform: sends all selected items in one emit instead of throttle-dropping all but the first (multi-select drag now syncs all) - TransformBox onDragEnd: persist+sync final state after resize/rotate (was only broadcasting ephemeral transforms, never the final position) - Layer lock toggle: add missing onCanvasChange() call for sync+save - Receiver handles both batched and legacy single-item transform formats
This commit is contained in:
@@ -126,13 +126,20 @@ export function useCanvasSetup(deps: CanvasSetupDeps) {
|
||||
},
|
||||
});
|
||||
|
||||
// Wire live drag/resize transforms to sync broadcast
|
||||
// Wire live drag/resize transforms to sync broadcast (batched for multi-select)
|
||||
selection.onItemsTransform = (items) => {
|
||||
syncRef.current?.broadcastTransform(items);
|
||||
};
|
||||
selection.onItemTransform = (item) => {
|
||||
syncRef.current?.broadcastTransform(item);
|
||||
};
|
||||
selection.transformBox.onItemTransform = (item) => {
|
||||
syncRef.current?.broadcastTransform(item);
|
||||
};
|
||||
selection.transformBox.onDragEnd = () => {
|
||||
syncRef.current?.broadcastSceneNow();
|
||||
onCanvasChange();
|
||||
};
|
||||
|
||||
socket.on('user:joined', (data: any) => {
|
||||
const uid = data.userId || data.id;
|
||||
|
||||
Reference in New Issue
Block a user