AndroidIconAnimator icon indicating copy to clipboard operation
AndroidIconAnimator copied to clipboard

Allow user to draw paths with the mouse

Open alexjlockwood opened this issue 9 years ago • 2 comments

How would you do this?

I assume you'd start by keeping track of the mouse event coordinates, stringing together the coordinates to create a series of very small lines that draw the stroked path.

Then maybe you'd condense those down into something that could be approximated by a smaller number of bezier curves? I wonder how complicated the math would be to do that...

alexjlockwood avatar Dec 19 '16 15:12 alexjlockwood

I guess it would require basically whatever math is working behind the scenes here: http://paperjs.org/examples/path-simplification/

alexjlockwood avatar Dec 19 '16 15:12 alexjlockwood

I know you said that you were opposed towards using paper.js... but it might actually be useful for stuff like this (i.e. for constructing the simplified path segments we need). The canvas could still mostly work the same as it does now... and I guess we could just use paper.js as a utility for doing hard math-y things that I probably wouldn't be able to write myself nearly as well. :P

alexjlockwood avatar Dec 19 '16 15:12 alexjlockwood