From 2ecbe8993ecbff9fb41725b22be0b29301fec51d Mon Sep 17 00:00:00 2001 From: king_he <6384784@qq.com> Date: Wed, 8 Jun 2022 09:43:30 +0000 Subject: [PATCH] update en/application-dev/reference/arkui-ts/ts-basic-gestures-swipegesture.md. Signed-off-by: king_he <6384784@qq.com> --- .../reference/arkui-ts/ts-basic-gestures-swipegesture.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/en/application-dev/reference/arkui-ts/ts-basic-gestures-swipegesture.md b/en/application-dev/reference/arkui-ts/ts-basic-gestures-swipegesture.md index 7e6ec61e15..f399b16210 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-gestures-swipegesture.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-gestures-swipegesture.md @@ -1,7 +1,7 @@ # SwipeGesture -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> **NOTE**
> This gesture is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. @@ -15,14 +15,14 @@ None SwipeGesture(value?: { fingers?: number; direction?: SwipeDirection; speed?: number }) - Parameters - | Name | Type | Mandatory | Default Value | Description | + | Name | Type | Mandatory | Default Value | Description | | -------- | -------- | -------- | -------- | -------- | | fingers | number | No | 1 | Minimum number of fingers to trigger a swipe gesture. The value ranges from 1 to 10. | | direction | SwipeDirection | No | SwipeDirection.All | Swipe direction. | | speed | number | No | 100 | Minimum speed of the swipe gesture (100 vp/s). | - SwipeDirection enums - | Name | Description | + | Name | Description | | -------- | -------- | | All | All directions. | | Horizontal | Horizontal direction. | @@ -37,7 +37,7 @@ SwipeGesture(value?: { fingers?: number; direction?: SwipeDirection; speed?: num - GestureEvent attributes related to the swipe gesture - | Name | Type | Description | + | Name | Type | Description | | -------- | -------- | -------- | | angle | number | Angle of the swipe gesture.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> Angle calculation method: After the swipe gesture is identified, a line connecting the two fingers is identified as the initial line. As the fingers swipe, the line between the fingers rotates. Based on the coordinates of the initial line's and current line's end points, an arc tangent function is used to calculate the respective included angle of the points relative to the horizontal direction. Rotation angle = arctan2(cy2-cy1,cx2-cx1) - arctan2(y2-y1,x2-x1). The initial line is used as the coordinate system. The clockwise rotation is 0 to 180 degrees, and the counter-clockwise rotation is –180 to 0 degrees. | | speed | number | Speed of the swipe gesture. | -- GitLab