agilgur5 / react-signature-canvas

A React wrapper component around signature_pad (in < 150 LoC). Unopinionated and heavily updated fork of react-signature-pad
https://agilgur5.github.io/react-signature-canvas/
Other
546 stars 119 forks source link

`time` attribute only present in last stroke #74

Open ralfstx opened 2 years ago

ralfstx commented 2 years ago

When a signature is given that consists of multiple strokes, the strokes array returned by toData() include the time attribute only in the last element.

Expected: All strokes should contain time information.

Example:

[
  [
    { "x": 68.33331298828125, "y": 110.61669921875 },
    { "x": 76.33331298828125, "y": 107.61669921875 },
    { "x": 84.33331298828125, "y": 105.61669921875 },
    …
  ],
  [
    { "x": 164.33331298828125, "y": 103.61669921875 },
    { "x": 170.33331298828125, "y": 103.61669921875 },
    { "x": 176.33331298828125, "y": 102.61669921875 },
    …
  ],
  [
    { "x": 317.33331298828125, "y": 100.61669921875, "time": 1646737591539 },
    { "x": 327.33331298828125, "y": 96.61669921875, "time": 1646737591584 },
    { "x": 333.33331298828125, "y": 95.61669921875, "time": 1646737591601 },
    …
  ]
]

Version: 1.0.5, on Firefox 97.0.2 (64-bit) ubuntu (snap)