Skip to content

Instantly share code, notes, and snippets.

@whatAboutJohn
Created September 26, 2015 07:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatAboutJohn/8210e1e3ac47e951426e to your computer and use it in GitHub Desktop.
Save whatAboutJohn/8210e1e3ac47e951426e to your computer and use it in GitHub Desktop.
Capture the Path on mousemove.
'mouse:move': function(event) {
if (mouse_down_status) {
var grouped_path = [];
var points = canvas.freeDrawingBrush.convertPointsToSVGPath(canvas.freeDrawingBrush._points);
points = points.filter(function(n){ return n != ' ' });
points.map(function(e, i) {
if (typeof points[i] == 'string') {
points[i] = points[i].replace(/ /g,'');
}
});
points.map(function(e, i) {
if(typeof e == 'string')
grouped_path.push([e]);
else
grouped_path[grouped_path.length - 1].push(e);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment