@antv/g-webgpu 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +20 -27
- package/dist/index.umd.min.js +4 -4
- package/package.json +6 -6
package/dist/index.umd.js
CHANGED
|
@@ -452,7 +452,7 @@
|
|
|
452
452
|
var _this = this;
|
|
453
453
|
|
|
454
454
|
var canvas = this.renderingContext.root.ownerDocument.defaultView;
|
|
455
|
-
var SUPPORT_ONLY_TOUCH = canvas.
|
|
455
|
+
var SUPPORT_ONLY_TOUCH = canvas.supportsTouchEvents && MOBILE_REGEX.test(navigator.userAgent);
|
|
456
456
|
|
|
457
457
|
var onPointerMove = function onPointerMove(ev) {
|
|
458
458
|
renderingService.hooks.pointerMove.call(ev);
|
|
@@ -533,24 +533,25 @@
|
|
|
533
533
|
while (1) {
|
|
534
534
|
switch (_context.prev = _context.next) {
|
|
535
535
|
case 0:
|
|
536
|
-
$el = _this.contextService.getDomElement();
|
|
536
|
+
$el = _this.contextService.getDomElement(); // @ts-ignore
|
|
537
537
|
|
|
538
|
-
if (
|
|
539
|
-
|
|
538
|
+
if (globalThis.navigator.msPointerEnabled) {
|
|
539
|
+
// @ts-ignore
|
|
540
|
+
$el.style.msContentZooming = 'none'; // @ts-ignore
|
|
541
|
+
|
|
542
|
+
$el.style.msTouchAction = 'none';
|
|
543
|
+
} else if (canvas.supportsPointerEvents) {
|
|
544
|
+
$el.style.touchAction = 'none';
|
|
540
545
|
}
|
|
541
546
|
|
|
542
|
-
if (
|
|
543
|
-
|
|
544
|
-
} else if (!canvas.supportTouchEvent) {
|
|
545
|
-
if (!canvas.supportPointerEvent) {
|
|
546
|
-
addMouseEventListener($el);
|
|
547
|
-
}
|
|
547
|
+
if (canvas.supportsPointerEvents) {
|
|
548
|
+
addPointerEventListener($el);
|
|
548
549
|
} else {
|
|
549
|
-
|
|
550
|
+
addMouseEventListener($el);
|
|
551
|
+
}
|
|
550
552
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
}
|
|
553
|
+
if (canvas.supportsTouchEvents) {
|
|
554
|
+
addTouchEventListener($el);
|
|
554
555
|
} // use passive event listeners
|
|
555
556
|
// @see https://zhuanlan.zhihu.com/p/24555031
|
|
556
557
|
|
|
@@ -560,7 +561,7 @@
|
|
|
560
561
|
capture: true
|
|
561
562
|
});
|
|
562
563
|
|
|
563
|
-
case
|
|
564
|
+
case 5:
|
|
564
565
|
case "end":
|
|
565
566
|
return _context.stop();
|
|
566
567
|
}
|
|
@@ -570,22 +571,14 @@
|
|
|
570
571
|
renderingService.hooks.destroy.tap(DOMInteractionPlugin_1.tag, function () {
|
|
571
572
|
var $el = _this.contextService.getDomElement();
|
|
572
573
|
|
|
573
|
-
if (canvas.
|
|
574
|
+
if (canvas.supportsPointerEvents) {
|
|
574
575
|
removePointerEventListener($el);
|
|
576
|
+
} else {
|
|
577
|
+
removeMouseEventListener($el);
|
|
575
578
|
}
|
|
576
579
|
|
|
577
|
-
if (
|
|
578
|
-
removeTouchEventListener($el);
|
|
579
|
-
} else if (!canvas.supportTouchEvent) {
|
|
580
|
-
if (!canvas.supportPointerEvent) {
|
|
581
|
-
removeMouseEventListener($el);
|
|
582
|
-
}
|
|
583
|
-
} else {
|
|
580
|
+
if (canvas.supportsTouchEvents) {
|
|
584
581
|
removeTouchEventListener($el);
|
|
585
|
-
|
|
586
|
-
if (!canvas.supportPointerEvent) {
|
|
587
|
-
removeMouseEventListener($el);
|
|
588
|
-
}
|
|
589
582
|
}
|
|
590
583
|
|
|
591
584
|
$el.removeEventListener('wheel', onPointerWheel, true);
|