Skip to content

Commit

Permalink
stylusData documentation. (#3112)
Browse files Browse the repository at this point in the history
## Description

This PR adds docs for `stylusData` object in events. 

>[!CAUTION]
> This has to be merged after finishing support for all main platforms (`web`/`android`/`iOS`)

## Test plan

Run docs
  • Loading branch information
m-bert authored Sep 25, 2024
1 parent 2ad43fe commit 0e7edff
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/docs/gestures/hover-gesture.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ X coordinate of the current position of the pointer relative to the window. The

Y coordinate of the current position of the pointer relative to the window. The value is expressed in point units. It is recommended to use it instead of [`y`](#y) in cases when the original view can be transformed as an effect of the gesture.

### `stylusData`

Object that contains additional information about `stylus`. It consists of the following fields:

- [`tiltX`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX) - angle in degrees between the Y-Z plane of the stylus and the screen.
- [`tiltY`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY) - angle in degrees between the X-Z plane of the stylus and the screen.
- [`altitudeAngle`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/altitudeAngle) - angle between stylus axis and the X-Y plane of a device screen.
- [`azimuthAngle`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/azimuthAngle) - angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis.
- [`pressure`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure) - indicates the normalized pressure of the stylus.

<BaseEventData />

## Remarks
Expand Down
10 changes: 10 additions & 0 deletions docs/docs/gestures/pan-gesture.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@ X coordinate of the current position of the pointer (finger or a leading pointer

Y coordinate of the current position of the pointer (finger or a leading pointer when there are multiple fingers placed) relative to the window. The value is expressed in point units. It is recommended to use it instead of [`y`](#y) in cases when the original view can be transformed as an effect of the gesture.

### `stylusData`

Object that contains additional information about `stylus`. It consists of the following fields:

- [`tiltX`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX) - angle in degrees between the Y-Z plane of the stylus and the screen.
- [`tiltY`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY) - angle in degrees between the X-Z plane of the stylus and the screen.
- [`altitudeAngle`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/altitudeAngle) - angle between stylus axis and the X-Y plane of a device screen.
- [`azimuthAngle`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/azimuthAngle) - angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis.
- [`pressure`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure) - indicates the normalized pressure of the stylus.

<BaseEventData />

## Example
Expand Down

0 comments on commit 0e7edff

Please sign in to comment.