-
Notifications
You must be signed in to change notification settings - Fork 84
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
Comments
vinothpandian
added a commit
that referenced
this issue
Aug 17, 2024
Fixes #143 Add support for custom path generator in `ReactSketchCanvas`. * Add `getSvgPathFromPoints` prop to `ReactSketchCanvas` component to accept a callback function for custom path generation. * Pass `getSvgPathFromPoints` prop to `Canvas` component. * Add `getSvgPathFromPoints` prop to `Canvas` component to accept a callback function for custom path generation. * Pass `getSvgPathFromPoints` prop to `SvgPath` component. * Modify `SvgPath` component to use the custom path generator if provided. * Update documentation in `README.md` to include the new `getSvgPathFromPoints` prop and its usage. * Add tests in `export.spec.tsx` to verify the functionality of the custom path generator. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/vinothpandian/react-sketch-canvas/issues/143?shareId=XXXX-XXXX-XXXX-XXXX).
vinothpandian
added a commit
that referenced
this issue
Aug 18, 2024
Fixes #143 Add support for custom path generator in `ReactSketchCanvas`. * Add `getSvgPathFromPoints` prop to `ReactSketchCanvas` component to accept a callback function for custom path generation. * Pass `getSvgPathFromPoints` prop to `Canvas` component. * Add `getSvgPathFromPoints` prop to `Canvas` component to accept a callback function for custom path generation. * Pass `getSvgPathFromPoints` prop to `SvgPath` component. * Modify `SvgPath` component to use the custom path generator if provided. * Update documentation in `README.md` to include the new `getSvgPathFromPoints` prop and its usage. * Add tests in `export.spec.tsx` to verify the functionality of the custom path generator. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/vinothpandian/react-sketch-canvas/issues/143?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
The text was updated successfully, but these errors were encountered: