Skip to content

Interface: StrokePoint ​

A single captured input sample within a stroke.

Coordinates are in the view's local coordinate space (CSS pixels / dp on Android, points on iOS) so a payload captured on a 3× device restores at the same physical position on a 1× device. The exact set of fields varies between platforms:

  • All platforms set x, y, t.
  • iOS additionally fills pressure, azimuth, altitude and size from PencilKit. Android leaves these undefined.

Unknown fields are ignored on setStrokeData, so payloads round-trip cleanly across platforms.

Properties ​

PropertyTypeDescription
altitude?numberiOS only. Pencil altitude angle in radians.
azimuth?numberiOS only. Pencil azimuth in radians.
pressure?numberiOS only. Force at this sample, in PencilKit's normalized 0..1 range.
size?numberiOS only. Per-point stroke width in points; preserved so restored strokes render at the same thickness as the originals.
tnumberTimestamp: on iOS this is the PencilKit timeOffset (seconds since stroke creation). On Android this is the absolute MotionEvent.eventTime (millisecond uptime). Only the relative deltas matter for replay.
xnumberX coordinate in the view's coordinate space.
ynumberY coordinate in the view's coordinate space.

Released under the MIT License.