How can i import path.segments string value { point: { x: 60.5, y: 219 } },{ point: { x: 219.5, y: 317 } } to a new path?

28 views
Skip to first unread message

intrd

unread,
Aug 15, 2012, 4:01:53 AM8/15/12
to pap...@googlegroups.com
example:
i can export segments value to a string when i do:
path.segments = $("#mytextbox").val();

but.. how can i import it to a new path?



intrd

unread,
Aug 15, 2012, 4:54:33 AM8/15/12
to pap...@googlegroups.com
i've just solved the problem:

exporting points to a text...
var aa = $("#myinputbox").val();
$("# myinputbox ").val(aa + '[' + event.point.x + ',' + event.point.y + '],');

importing to a new path:

        var mypath = new Path([[63.5,49],[63.5,117],[96.5,93],[70.5,51],[107.5,106],[111.5,57],[122.5,96],[110.5,88],[135.5,95],[148.5,42],[158.5,91],[180.5,49]]);
heartPath.strokeColor = 'red';
path = new Path( mypath);
perfect!
if anyone have another way to do it, please share!
Reply all
Reply to author
Forward
0 new messages