Skip to content

Commit 731aa2b

Browse files
committed
Fix on drag handle action.
1 parent a4b7081 commit 731aa2b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

spine-ts/spine-construct3/src/c3runtime/instance.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,14 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
324324
pose.y = -y * spine.Skeleton.yDir;
325325
}
326326
} else if (!this.prevLeftClickDown) {
327-
const applied = bone.applied;
328-
const { x, y } = matrix.gameToSkeleton(touchX, touchY);
327+
const { x: boneGameX, y: boneGameY } = matrix.boneToGame(bone);
329328
const inside = handleObject.slot
330-
? this.isInsideSlot(x, y, handleObject.slot, true)
331-
: this.inRadius(x, y, applied.worldX, applied.worldY, handleObject.radius);
329+
? this.isInsideSlot(touchX, touchY, handleObject.slot)
330+
: this.inRadius(touchX, touchY, boneGameX, boneGameY, handleObject.radius);
332331
if (inside) {
333332
handleObject.dragging = true;
334-
handleObject.offsetX = x - applied.worldX;
335-
handleObject.offsetY = y - applied.worldY;
333+
handleObject.offsetX = touchX - boneGameX;
334+
handleObject.offsetY = touchY - boneGameY;
336335
}
337336
}
338337
}

0 commit comments

Comments
 (0)