dist/jcanvas-handles.js
function addPathHandles($canvas, parent) {
	var key, xProp, yProp;
	for (key in parent) {
		if (Object.prototype.hasOwnProperty.call(parent, key)) {
			// If property is a control point
			if (key.match(/c?x(\d+)/gi) !== null) {
				// Get the x and y coordinates for that control point
				xProp = key;
				yProp = key.replace('x', 'y');
				// Add handle at control point
				addPathHandle($canvas, parent, xProp, yProp);
			}
		}
	}
	// Add guides connecting handles
	if (parent.guide) {
		addPathGuides($canvas, parent);
	}
}
function addPathHandles($canvas, parent) {
	var key, xProp, yProp;
	for (key in parent) {
		if (Object.prototype.hasOwnProperty.call(parent, key)) {
			// If property is a control point
			if (key.match(/c?x(\d+)/gi) !== null) {
				// Get the x and y coordinates for that control point
				xProp = key;
				yProp = key.replace('x', 'y');
				// Add handle at control point
				addPathHandle($canvas, parent, xProp, yProp);
			}
		}
	}
	// Add guides connecting handles
	if (parent.guide) {
		addPathGuides($canvas, parent);
	}
}
function addPathHandles ( $canvas , parent ) { var key , xProp , yProp ; for ( key in parent ) { if ( Object . prototype . hasOwnProperty . call ( parent , key ) ) { // If property is a control point if ( key . match ( / c?x(\d+) / gi ) !== null ) { // Get the x and y coordinates for that control point xProp = key ; yProp = key . replace ( 'x' , 'y' ) ; // Add handle at control point addPathHandle ( $canvas , parent , xProp , yProp ) ; } } } // Add guides connecting handles if ( parent . guide ) { addPathGuides ( $canvas , parent ) ; } }
Add handles to line path
Add handles to line path