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

Best way to interact with paths #503

Open
vincent opened this issue Apr 22, 2022 · 0 comments
Open

Best way to interact with paths #503

vincent opened this issue Apr 22, 2022 · 0 comments

Comments

@vincent
Copy link

vincent commented Apr 22, 2022

Hi, thank you for the lib !

I would like to use it for drawing areas on top of an image, and interact with drawn <path>.
Some use cases I have in mind:

  • give path an id
  • hovering paths and get the ref
  • rejecting a path upon drawing

As a workaround I monkey-patched the drawHandler like

const [renderRef, draw] = useSvgDrawing()
const drawing = draw.ref.current;

const end = drawing.drawHandler.end;
drawing.drawHandler.end = (event) => {
  end()
  // my code
}

But it's really not good enough.

Do you have any pointers to share about this ?

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