浏览代码

Rename property

customisations
alemart 10 个月前
父节点
当前提交
97f4c5f87a

+ 2
- 2
docs/api/trackable-pointer.md 查看文件

64
 
64
 
65
 Whether or not this is the primary pointer among all pointers of this [type](#type). A typical primary pointer is that of a finger that touches the screen when no other fingers are touching it.
65
 Whether or not this is the primary pointer among all pointers of this [type](#type). A typical primary pointer is that of a finger that touches the screen when no other fingers are touching it.
66
 
66
 
67
-### type
67
+### kind
68
 
68
 
69
-`pointer.type: string, read-only`
69
+`pointer.kind: string, read-only`
70
 
70
 
71
 The type of device that originated this pointer. Typically `"touch"`, `"mouse"` or `"pen"`.
71
 The type of device that originated this pointer. Typically `"touch"`, `"mouse"` or `"pen"`.

+ 2
- 2
src/trackers/pointer-tracker/pointer-tracker.ts 查看文件

276
             const isPrimary = event.isPrimary;
276
             const isPrimary = event.isPrimary;
277
 
277
 
278
             // determine the type of the originating device
278
             // determine the type of the originating device
279
-            const type = event.pointerType;
279
+            const kind = event.pointerType;
280
 
280
 
281
             // we create new trackable instances on each frame;
281
             // we create new trackable instances on each frame;
282
             // these will be exported and consumed by the user
282
             // these will be exported and consumed by the user
283
-            this._newPointers.set(id, { id, phase, position, deltaPosition, initialPosition, velocity, elapsedTime, isPrimary, type });
283
+            this._newPointers.set(id, { id, phase, position, deltaPosition, initialPosition, velocity, elapsedTime, isPrimary, kind });
284
 
284
 
285
         }
285
         }
286
 
286
 

+ 1
- 1
src/trackers/pointer-tracker/trackable-pointer.ts 查看文件

63
     readonly isPrimary: boolean;
63
     readonly isPrimary: boolean;
64
 
64
 
65
     /** the type of the originating device; typically "mouse", "touch" or "pen" */
65
     /** the type of the originating device; typically "mouse", "touch" or "pen" */
66
-    readonly type: string;
66
+    readonly kind: string;
67
 }
67
 }

正在加载...
取消
保存