This commit is contained in:
2025-11-02 22:08:15 +01:00
parent 3c24b890a4
commit 74aacbc1eb
3 changed files with 44 additions and 14 deletions
+7 -1
View File
@@ -171,6 +171,7 @@ const useDocumentDrag = () => {
const rotation = simulationState.rotation;
layoutRef.current.set(docId, { ...entry, rotation });
markLayoutDirty?.();
const node = itemRefs.current.get(docId);
if (node) {
@@ -185,7 +186,7 @@ const useDocumentDrag = () => {
const isSettled = Math.abs(angularVelocity) < SETTLE_ANGULAR_VELOCITY;
return isSettled;
},
[itemRefs, layoutRef],
[itemRefs, layoutRef, markLayoutDirty],
);
const startInertiaAnimation = useCallback(
@@ -627,6 +628,8 @@ const useDocumentDrag = () => {
item.displayRotation += (item.targetRotation - item.displayRotation) * rotationBlend;
}
markLayoutDirty?.();
const entryItem = layoutRef.current.get(item.docId) || {};
layoutRef.current.set(item.docId, {
...entryItem,
@@ -780,6 +783,8 @@ const useDocumentDrag = () => {
const pointerInsideCard =
Math.abs(pointerLocalX) <= halfWidth && Math.abs(pointerLocalY) <= halfHeight;
markLayoutDirty?.();
const currentTimestamp =
typeof event.timeStamp === 'number' && Number.isFinite(event.timeStamp)
? event.timeStamp
@@ -829,6 +834,7 @@ const useDocumentDrag = () => {
recalcVisibleDocIds,
debugDrag,
onDocumentStackSelect,
markLayoutDirty,
],
);