mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
Fix updateHandles getting mouse unsafely.
This commit is contained in:
parent
9d7172602f
commit
a6519f3017
@ -313,7 +313,16 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private updateHandles (skeleton: Skeleton) {
|
private updateHandles (skeleton: Skeleton) {
|
||||||
const mouse = this.runtime.mouse;
|
if (this.dragHandles.size === 0) return;
|
||||||
|
|
||||||
|
// accessing mouse without having a mouse object will throw an error
|
||||||
|
let mouse: IMouseObjectType;
|
||||||
|
try {
|
||||||
|
mouse = this.runtime.mouse;
|
||||||
|
} catch (_) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const isLeftClickDown = mouse.isMouseButtonDown(0);
|
const isLeftClickDown = mouse.isMouseButtonDown(0);
|
||||||
if (this.dragHandles.size <= 0) {
|
if (this.dragHandles.size <= 0) {
|
||||||
this.prevLeftClickDown = isLeftClickDown;
|
this.prevLeftClickDown = isLeftClickDown;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user