|
@@ -203,12 +203,16 @@ export class PointerDragBehavior implements Behavior<AbstractMesh> {
|
|
var pointerId = (<PointerEvent>pointerInfo.event).pointerId;
|
|
var pointerId = (<PointerEvent>pointerInfo.event).pointerId;
|
|
|
|
|
|
// If drag was started with anyMouseID specified, set pointerID to the next mouse that moved
|
|
// If drag was started with anyMouseID specified, set pointerID to the next mouse that moved
|
|
- if (this.currentDraggingPointerID === PointerDragBehavior._AnyMouseID && pointerId !== PointerDragBehavior._AnyMouseID && (<PointerEvent>pointerInfo.event).pointerType == "mouse") {
|
|
|
|
- if (this._lastPointerRay[this.currentDraggingPointerID]) {
|
|
|
|
- this._lastPointerRay[pointerId] = this._lastPointerRay[this.currentDraggingPointerID];
|
|
|
|
- delete this._lastPointerRay[this.currentDraggingPointerID];
|
|
|
|
|
|
+ if (this.currentDraggingPointerID === PointerDragBehavior._AnyMouseID && pointerId !== PointerDragBehavior._AnyMouseID) {
|
|
|
|
+ const evt = <PointerEvent>pointerInfo.event;
|
|
|
|
+ const isMouseEvent = evt.pointerType === "mouse" || (!this._scene.getEngine().hostInformation.isMobile && evt instanceof MouseEvent);
|
|
|
|
+ if (isMouseEvent) {
|
|
|
|
+ if (this._lastPointerRay[this.currentDraggingPointerID]) {
|
|
|
|
+ this._lastPointerRay[pointerId] = this._lastPointerRay[this.currentDraggingPointerID];
|
|
|
|
+ delete this._lastPointerRay[this.currentDraggingPointerID];
|
|
|
|
+ }
|
|
|
|
+ this.currentDraggingPointerID = pointerId;
|
|
}
|
|
}
|
|
- this.currentDraggingPointerID = pointerId;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// Keep track of last pointer ray, this is used simulating the start of a drag in startDrag()
|
|
// Keep track of last pointer ray, this is used simulating the start of a drag in startDrag()
|