typescript

This commit is contained in:
2025-11-13 02:37:16 +01:00
parent ada089c05b
commit 6d55e61cee
43 changed files with 923 additions and 406 deletions
+7 -2
View File
@@ -56,6 +56,7 @@ interface DragGroupItemInternal extends EngineGroupItem {
offsetX?: number;
offsetY?: number;
targetRotation?: number;
initialRotation?: number;
}
type EnsureDocumentSizeFn = (doc: DocumentLike | null | undefined) => DocumentSizeInfo | null;
@@ -466,9 +467,9 @@ const useDocumentDrag = (options: UseDocumentDragOptions) => {
baseOffsetY,
offsetX: baseOffsetX,
offsetY: baseOffsetY,
initialRotation,
targetRotation: initialRotation,
displayRotation: initialRotation,
targetRotation,
} satisfies DragGroupItemInternal;
});
@@ -897,6 +898,7 @@ const useDocumentDrag = (options: UseDocumentDragOptions) => {
if (state.moved) {
commitActiveDragTransforms([state.docKey]);
const inertiaState: EngineInertiaState = {
docId: state.docKey,
restRotation: state.restRotation,
dynamicRotation: state.dynamicRotation,
angularVelocity: state.angularVelocity,
@@ -904,6 +906,7 @@ const useDocumentDrag = (options: UseDocumentDragOptions) => {
width: state.width,
height: state.height,
dragScale: state.dragScale || 1,
lastTimestamp: state.lastTimestamp,
};
const docId = state.docKey;
finishDrag(event.pointerId);
@@ -956,6 +959,7 @@ const useDocumentDrag = (options: UseDocumentDragOptions) => {
commitActiveDragTransforms([state.docKey]);
const inertiaState: EngineInertiaState = {
docId: state.docKey,
restRotation: state.restRotation,
dynamicRotation: state.dynamicRotation,
angularVelocity: state.angularVelocity,
@@ -963,6 +967,7 @@ const useDocumentDrag = (options: UseDocumentDragOptions) => {
width: state.width,
height: state.height,
dragScale: state.dragScale || 1,
lastTimestamp: state.lastTimestamp,
};
const docId = state.docKey;
finishDrag(event.pointerId);