Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom paths #143

Open
bitttttten opened this issue Nov 17, 2023 · 0 comments
Open

Custom paths #143

bitttttten opened this issue Nov 17, 2023 · 0 comments

Comments

@bitttttten
Copy link

Is your feature request related to a problem? Please describe.
I would love to be able to give my own path generator script to react-sketch-canvas. For example on https://www.tldraw.com/ they have a few different brush types that use a custom generator to produce the SVG. It would be great to be able to drop in our own pens to react-sketch-canvas.

Describe the solution you'd like
Perhaps a way to pass a callback that receives the current path as an array and takes back an SVG path?

Thinking out loud here although I can imagine a callback something like the below:

<ReactSketchCanvas
      style={styles}
      width="600"
      height="400"
      strokeWidth={4}
      strokeColor="red"
      getSvgPathFromPoints={(points: Vec2d[]) => `M${points.map(getPoint)}`}
    />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant