Skip to content
This repository was archived by the owner on Jun 5, 2022. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ktjd123 committed Aug 3, 2021
1 parent b72b1ad commit 4ab9f7c
Show file tree
Hide file tree
Showing 3 changed files with 975 additions and 1,067 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-image-zoom-fixed",
"version": "2.3.0",
"version": "2.3.1",
"description": "react native image pan zoom",
"repository": "https://github.com/ktjd123/react-native-image-zoom",
"main": "built/index.js",
Expand Down Expand Up @@ -31,8 +31,8 @@
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-react-native": "^3.8.1",
"prettier": "^2.0.5",
"react": "*",
"react-native": "*",
"react": "^16.13.1",
"react-native": "^0.62.2",
"typescript": "^3.9.2"
}
}
6 changes: 3 additions & 3 deletions src/image-zoom/image-zoom.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ export default class ImageViewer extends React.Component<ImageZoomProps, ImageZo
private centerDiffY = 0;

// 触发单击的 timeout
private singleClickTimeout: number | undefined;
private singleClickTimeout: ReturnType<typeof setTimeout> | undefined;

// 计算长按的 timeout
private longPressTimeout: number | undefined;
private longPressTimeout: ReturnType<typeof setTimeout> | undefined;

// 上一次点击的时间
private lastClickTime = 0;
Expand Down Expand Up @@ -212,7 +212,7 @@ export default class ImageViewer extends React.Component<ImageZoomProps, ImageZo

if (Math.abs(this.horizontalWholeCounter) > 5 || Math.abs(this.verticalWholeCounter) > 5) {
// 如果位移超出手指范围,取消长按监听
clearTimeout(this.longPressTimeout);
if (this.longPressTimeout) clearTimeout(this.longPressTimeout);
}

if (this.props.panToMove) {
Expand Down
Loading

0 comments on commit 4ab9f7c

Please sign in to comment.