Skip to content

Commit b98267d

Browse files
author
likai
committed
fix: 修复chrome端模拟移动设备时截取不生效问题
1 parent b27fa5f commit b98267d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,11 @@ export default class ScreenShot {
515515
if (event instanceof MouseEvent && event.button != 0) return;
516516

517517
// 当前处于移动端触摸时,需要在按下时判断当前坐标点是否处于裁剪框内,主动更新draggingTrim状态(移动端的move事件只会在按下时才会触发)
518-
if (!isPC() && event instanceof TouchEvent && this.screenShotCanvas) {
518+
if (
519+
isTouchDevice() &&
520+
event instanceof TouchEvent &&
521+
this.screenShotCanvas
522+
) {
519523
this.operatingCutOutBox(
520524
event.touches[0].pageX,
521525
event.touches[0].pageY,

0 commit comments

Comments
 (0)