react-native-skia icon indicating copy to clipboard operation
react-native-skia copied to clipboard

Return isPencil prop on touch

Open mzruiz opened this issue 3 years ago • 3 comments

Issues

  • #460
  • #735

To Do

  • [x] RN Updates to add isPencil to touch props to satisfy TypeScript
  • [ ] Android Support
  • [ ] Web Support

Using With a simple setup like the one found with the Touch Events example, it can be used like:

  const touchHandler = useTouchHandler({
    onActive: ({ x, y, isPencil }) => {
      ...
    },
  });

P.S., This is my first ever open source PR so I appreciate y'alls patience.

mzruiz avatar Aug 10 '22 13:08 mzruiz

could you add a web implementation for this? https://github.com/Shopify/react-native-skia/blob/main/package/src/views/SkiaView.web.tsx#L145

wcandillon avatar Aug 10 '22 14:08 wcandillon

Hi @mzruiz !! Thanks so much for the PR and also congrats with the first PR to a public project :)

Since you're not done with the PR (looks like there are some outstanding issues like Android / Web) I converted the PR too a draft, and then we can discuss the issues together here even though the PR is not yet done.

chrfalch avatar Aug 11 '22 10:08 chrfalch

@mzruiz thanks for the PR! I created #735 . Can you please use a more "generic" name like toolType field instead of isPencil to support other touch devices in the future like "Eraser"?

rhalaly avatar Aug 19 '22 22:08 rhalaly