Hello,
I'm experimenting with making a freehand drawing component using elm-svg. I have most of the code mocked up, but I can't figure out how to get mouse coordinates from Svg.Events.
Basically, I want to have actions that look something like this:
type Action
= StartStroke Float Float
| ContinueStroke Float Float
| EndStroke Float Float
where the floats are the (x, y) coordinates relative to the SVG element. These actions should be activated by Svg.Events.mouseup, mousedown, and mousemove, but I need to figure out how to supply the (x, y) coordinates to the action.
If someone could give me some pointers on how to proceed, I'd be very grateful! (And if I'm doing something ridiculous, approach-wise or in my Elm code, please let me know also.)
Thanks,
Michelle