fix
This commit is contained in:
@@ -123,7 +123,7 @@ const useDocumentDrag = (options = {}) => {
|
||||
capturedTarget.releasePointerCapture(pointerId);
|
||||
} catch (error) {
|
||||
if (debugDrag) {
|
||||
console.warn('[desk] releasePointerCapture failed', error);
|
||||
void error;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -143,18 +143,6 @@ const useDocumentDrag = (options = {}) => {
|
||||
|
||||
const handlePointerDown = useCallback(
|
||||
(event, docIdInput, options = {}) => {
|
||||
if (debugDrag) {
|
||||
console.log(
|
||||
'[desk] handlePointerDown fired for doc',
|
||||
docIdInput,
|
||||
'button',
|
||||
event.button,
|
||||
'pointerType',
|
||||
event.pointerType,
|
||||
'pointerId',
|
||||
event.pointerId,
|
||||
);
|
||||
}
|
||||
preventAll(event);
|
||||
|
||||
const docId = docIdInput != null ? docIdInput : null;
|
||||
@@ -268,7 +256,7 @@ const useDocumentDrag = (options = {}) => {
|
||||
capturedTarget.setPointerCapture(event.pointerId);
|
||||
} catch (error) {
|
||||
if (debugDrag) {
|
||||
console.warn('[desk] setPointerCapture failed', error);
|
||||
void error;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -424,22 +412,11 @@ const useDocumentDrag = (options = {}) => {
|
||||
(event) => {
|
||||
const state = dragStateRef.current;
|
||||
if (!state) {
|
||||
if (debugDrag) {
|
||||
console.log('[desk] handlePointerMove: no drag state for pointer', event.pointerId);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (state.pointerId !== event.pointerId) {
|
||||
if (debugDrag) {
|
||||
console.log(
|
||||
'[desk] handlePointerMove: pointer mismatch expected',
|
||||
state.pointerId,
|
||||
'got',
|
||||
event.pointerId,
|
||||
);
|
||||
if (state.pointerId !== event.pointerId) {
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
preventAll(event);
|
||||
|
||||
if (state.isGroup) {
|
||||
@@ -550,7 +527,6 @@ const useDocumentDrag = (options = {}) => {
|
||||
setDragTransform(item.docId, payload);
|
||||
const node = itemRefs.current.get(item.docId);
|
||||
applyDomTransform(node, payload);
|
||||
console.log('[desk] drag update', item.docId, payload.centerX, payload.centerY);
|
||||
});
|
||||
|
||||
state.lastClientX = event.clientX;
|
||||
@@ -565,9 +541,6 @@ const useDocumentDrag = (options = {}) => {
|
||||
return;
|
||||
}
|
||||
if (state.locked) {
|
||||
if (debugDrag) {
|
||||
console.log('[desk] handlePointerMove: locked drag for doc', state.docKey);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -669,7 +642,6 @@ const useDocumentDrag = (options = {}) => {
|
||||
setDragTransform(state.docKey, transformPayload);
|
||||
const primaryNode = itemRefs.current.get(state.docKey);
|
||||
applyDomTransform(primaryNode, transformPayload);
|
||||
console.log('[desk] drag update', state.docKey, transformPayload.centerX, transformPayload.centerY);
|
||||
|
||||
const offsetX = pointerCanvasX - currentCenterX;
|
||||
const offsetY = pointerCanvasY - currentCenterY;
|
||||
@@ -710,9 +682,7 @@ const useDocumentDrag = (options = {}) => {
|
||||
state.localPointerOffsetY = updatedLocalOffsetY;
|
||||
}
|
||||
|
||||
if (debugDrag) {
|
||||
console.log('[desk] handlePointerMove: moved doc', state.docKey, 'to', currentCenterX, currentCenterY);
|
||||
}
|
||||
void debugDrag;
|
||||
},
|
||||
[
|
||||
bringToFront,
|
||||
|
||||
Reference in New Issue
Block a user