Fix on drag handle action.

This commit is contained in:
Davide Tantillo 2026-02-04 16:41:11 +01:00
parent a4b7081ba3
commit 731aa2bdf1

View File

@ -324,15 +324,14 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
pose.y = -y * spine.Skeleton.yDir; pose.y = -y * spine.Skeleton.yDir;
} }
} else if (!this.prevLeftClickDown) { } else if (!this.prevLeftClickDown) {
const applied = bone.applied; const { x: boneGameX, y: boneGameY } = matrix.boneToGame(bone);
const { x, y } = matrix.gameToSkeleton(touchX, touchY);
const inside = handleObject.slot const inside = handleObject.slot
? this.isInsideSlot(x, y, handleObject.slot, true) ? this.isInsideSlot(touchX, touchY, handleObject.slot)
: this.inRadius(x, y, applied.worldX, applied.worldY, handleObject.radius); : this.inRadius(touchX, touchY, boneGameX, boneGameY, handleObject.radius);
if (inside) { if (inside) {
handleObject.dragging = true; handleObject.dragging = true;
handleObject.offsetX = x - applied.worldX; handleObject.offsetX = touchX - boneGameX;
handleObject.offsetY = y - applied.worldY; handleObject.offsetY = touchY - boneGameY;
} }
} }
} }