mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Fixed issues with slot events on mobile.
This commit is contained in:
parent
c8b0272ca8
commit
49afa43d8f
@ -561,6 +561,7 @@ export class SpineWebComponentWidget extends HTMLElement implements Disposable,
|
|||||||
*/
|
*/
|
||||||
public cursorBoundsEventCallback = (event: CursorEventTypes, originalEvent?: UIEvent) => { }
|
public cursorBoundsEventCallback = (event: CursorEventTypes, originalEvent?: UIEvent) => { }
|
||||||
|
|
||||||
|
// TODO: probably it makes sense to associate a single callback to a groups of slots to avoid the same callback to be called for each slot of the group
|
||||||
/**
|
/**
|
||||||
* This methods allows to associate to a Slot a callback. For these slots, if the widget is interactive,
|
* This methods allows to associate to a Slot a callback. For these slots, if the widget is interactive,
|
||||||
* when the cursor performs actions within the slot's attachment the associated callback is invoked with
|
* when the cursor performs actions within the slot's attachment the associated callback is invoked with
|
||||||
@ -1185,13 +1186,6 @@ export class SpineWebComponentWidget extends HTMLElement implements Disposable,
|
|||||||
|
|
||||||
const { slotFunction, inside } = interactionState
|
const { slotFunction, inside } = interactionState
|
||||||
|
|
||||||
if (type === "down" || type === "up") {
|
|
||||||
if (inside) {
|
|
||||||
slotFunction(slot, type, originalEvent);
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
let vertices = this.verticesTemp;
|
let vertices = this.verticesTemp;
|
||||||
let hullLength = 8;
|
let hullLength = 8;
|
||||||
|
|
||||||
@ -1213,6 +1207,13 @@ export class SpineWebComponentWidget extends HTMLElement implements Disposable,
|
|||||||
slotFunction(slot, "enter", originalEvent);
|
slotFunction(slot, "enter", originalEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === "down" || type === "up") {
|
||||||
|
if (interactionState.inside) {
|
||||||
|
slotFunction(slot, type, originalEvent);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
slotFunction(slot, type, originalEvent);
|
slotFunction(slot, type, originalEvent);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user