I would like some help on the path constructor in Raphael. Im not sure how to draw a straight line from one point to another. I have
var line = paper.path(M 100 0 1 0 30 100)
I want to draw a line from point1 (100 0) to point2 (30 100)
It's very simple:
var line = paper.path( "M100,0 L30,100" );
You can also build your paths out of arrays, which is really useful in some circumstances.
var line = paper.path( ["M", 100, 0, "L", 30, 100 ] );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With