MCPcopy Create free account
hub / github.com/CoderOpen/waimai / checkTouch

Method checkTouch

front/components/mpvueGestureLock/gestureLock.js:68–88  ·  view source on GitHub ↗
({
        x,
        y
    })

Source from the content-addressed store, hash-verified

66
67 // 检测当时 触摸位置是否位于 锁上
68 checkTouch({
69 x,
70 y
71 }) {
72 for (let i = 0; i < this.circleArray.length; i++) {
73 let point = this.circleArray[i];
74 if (this.isPointInCycle(x, y, point.x, point.y, point.radius)) {
75 if (!point.check) {
76 this.checkPoints.push(point.count);
77 if (this.lastCheckPoint != 0) {
78 // 已激活锁之间的线段
79 const line = this.drawLine(this.lastCheckPoint, point);
80 this.lineArray.push(line);
81 }
82 this.lastCheckPoint = point;
83 }
84 point.check = true;
85 return;
86 }
87 }
88 }
89
90 // 画线 - 返回 样式 对象
91 drawLine(start, end) {

Callers 2

onTouchStartMethod · 0.95
moveDrawMethod · 0.95

Calls 2

isPointInCycleMethod · 0.95
drawLineMethod · 0.95

Tested by

no test coverage detected