From 0e7edff759dfc39a4505ecd7f0f1a8fac5d12ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bert?= <63123542+m-bert@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:34:55 +0200 Subject: [PATCH] `stylusData` documentation. (#3112) ## 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 --- docs/docs/gestures/hover-gesture.md | 10 ++++++++++ docs/docs/gestures/pan-gesture.md | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/docs/docs/gestures/hover-gesture.md b/docs/docs/gestures/hover-gesture.md index b9681625d0..2018bf449b 100644 --- a/docs/docs/gestures/hover-gesture.md +++ b/docs/docs/gestures/hover-gesture.md @@ -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. + ## Remarks diff --git a/docs/docs/gestures/pan-gesture.md b/docs/docs/gestures/pan-gesture.md index 0e5446eec2..95a3a569bd 100644 --- a/docs/docs/gestures/pan-gesture.md +++ b/docs/docs/gestures/pan-gesture.md @@ -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. + ## Example