canvas组件的@touchstart、@touchmove、@touchend获取的坐标是从屏幕左上角作为原点开始?
为什么不是从画布的左上角作为原点?
<canvas id="canvas" ref="canvas" style="width: 600rpx;height: 360rpx;"
@touchstart="handleTouchStart" @touchmove="handleTouchMove"
@touchend="handleTouchEnd"></canvas>
handleTouchStart(e : TouchEvent) {
if (this.ctx != null) {
const touch = e.touches[0];
let x = touch.clientX
let y = touch.clientY
console.log(x, y)
}
},
//other like this
0 个回复