canvas - Variable length arrow with FabricJS Path() -
i'm trying make variable length arrow in fabric.js using path().
new fabric.path('m 0 0 l 150 0 m 0 0 l 10 -10 m 0 0 l 10 10 z', {});
this creates fixed length arrow, i'd work follows:
- click on canvas, arrow tip appears (keep mouse down , drag endposition)
- when drag arrow endposition line gets longer tip stays same size
- still while dragging line stays attached point of origin , whole arrow rotates around until dragging stops
can done? , how create functionality?
help appreciated!
edit:
found fiddle http://jsfiddle.net/7a5ms/51/ i'm looking for, calculation of arrow angle off. anyone?
managed code working fiddle.
Comments
Post a Comment