mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 02:36:56 +08:00
Fix on drag handle action.
This commit is contained in:
parent
a4b7081ba3
commit
731aa2bdf1
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user