dist/jcanvas.js
function _closePath(canvas, ctx, params) {
	var data;

	// Optionally close path
	if (params.closed) {
		ctx.closePath();
	}

	if (params.shadowStroke && params.strokeWidth !== 0) {
		// Extend the shadow to include the stroke of a drawing

		// Add a stroke shadow by stroking before filling
		ctx.stroke();
		ctx.fill();
		// Ensure the below stroking does not inherit a shadow
		ctx.shadowColor = 'transparent';
		ctx.shadowBlur = 0;
		// Stroke over fill as usual
		ctx.stroke();

	} else {
		// If shadowStroke is not enabled, stroke & fill as usual

		ctx.fill();
		// Prevent extra shadow created by stroke (but only when fill is present)
		if (params.fillStyle !== 'transparent') {
			ctx.shadowColor = 'transparent';
		}
		if (params.strokeWidth !== 0) {
			// Only stroke if the stroke is not 0
			ctx.stroke();
		}

	}

	// Optionally close path
	if (!params.closed) {
		ctx.closePath();
	}

	// Restore individual shape transformation
	_restoreTransform(ctx, params);

	// Mask shape if chosen
	if (params.mask) {
		// Retrieve canvas data
		data = _getCanvasData(canvas);
		_enableMasking(ctx, data, params);
	}

}
function _closePath(canvas, ctx, params) {
	var data;

	// Optionally close path
	if (params.closed) {
		ctx.closePath();
	}

	if (params.shadowStroke && params.strokeWidth !== 0) {
		// Extend the shadow to include the stroke of a drawing

		// Add a stroke shadow by stroking before filling
		ctx.stroke();
		ctx.fill();
		// Ensure the below stroking does not inherit a shadow
		ctx.shadowColor = 'transparent';
		ctx.shadowBlur = 0;
		// Stroke over fill as usual
		ctx.stroke();

	} else {
		// If shadowStroke is not enabled, stroke & fill as usual

		ctx.fill();
		// Prevent extra shadow created by stroke (but only when fill is present)
		if (params.fillStyle !== 'transparent') {
			ctx.shadowColor = 'transparent';
		}
		if (params.strokeWidth !== 0) {
			// Only stroke if the stroke is not 0
			ctx.stroke();
		}

	}

	// Optionally close path
	if (!params.closed) {
		ctx.closePath();
	}

	// Restore individual shape transformation
	_restoreTransform(ctx, params);

	// Mask shape if chosen
	if (params.mask) {
		// Retrieve canvas data
		data = _getCanvasData(canvas);
		_enableMasking(ctx, data, params);
	}

}
function _closePath ( canvas , ctx , params ) { var data ; // Optionally close path if ( params . closed ) { ctx . closePath ( ) ; } if ( params . shadowStroke && params . strokeWidth !== 0 ) { // Extend the shadow to include the stroke of a drawing // Add a stroke shadow by stroking before filling ctx . stroke ( ) ; ctx . fill ( ) ; // Ensure the below stroking does not inherit a shadow ctx . shadowColor = 'transparent' ; ctx . shadowBlur = 0 ; // Stroke over fill as usual ctx . stroke ( ) ; } else { // If shadowStroke is not enabled, stroke & fill as usual ctx . fill ( ) ; // Prevent extra shadow created by stroke (but only when fill is present) if ( params . fillStyle !== 'transparent' ) { ctx . shadowColor = 'transparent' ; } if ( params . strokeWidth !== 0 ) { // Only stroke if the stroke is not 0 ctx . stroke ( ) ; } } // Optionally close path if ( ! params . closed ) { ctx . closePath ( ) ; } // Restore individual shape transformation _restoreTransform ( ctx , params ) ; // Mask shape if chosen if ( params . mask ) { // Retrieve canvas data data = _getCanvasData ( canvas ) ; _enableMasking ( ctx , data , params ) ; } }
Close current canvas path
Close current canvas path