Use EventTarget object for pos.target property
Not sure if this really matters.
This commit is contained in:
parent
12ef5175d5
commit
c2170e12ea
1 changed files with 3 additions and 3 deletions
|
|
@ -94,15 +94,15 @@ export class HTMLManager {
|
|||
*/
|
||||
extractPosition(event: any, tidx=0): any {
|
||||
let pos = event;
|
||||
|
||||
const canvas = this.extractTarget(event) as HTMLCanvasElement;
|
||||
const target = this.extractTarget(event, tidx);
|
||||
const canvas = target as HTMLCanvasElement;
|
||||
if (event.changedTouches) {
|
||||
pos = {
|
||||
pageX: Math.round(event.changedTouches[tidx].pageX),
|
||||
pageY: Math.round(event.changedTouches[tidx].pageY),
|
||||
clientX: Math.round(event.changedTouches[tidx].clientX),
|
||||
clientY: Math.round(event.changedTouches[tidx].clientY),
|
||||
target: canvas
|
||||
target: target
|
||||
}
|
||||
if (["touchmove", "touchend"].indexOf(event.type) > -1) {
|
||||
// touch events target source element
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue