Created
September 26, 2015 07:29
-
-
Save whatAboutJohn/8210e1e3ac47e951426e to your computer and use it in GitHub Desktop.
Capture the Path on mousemove.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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