docs: function draw(canvas, ctx, data, params, layer) {
  
  		// If width and sWidth are not defined, use image width
  		if (params.width === null && params.sWidth === null) {
  			params.width = params.sWidth = img.width;
  		}
  		// If width and sHeight are not defined, use image height
  		if (params.height === null && params.sHeight === null) {
  			params.height = params.sHeight = img.height;
  		}
  
  		// Ensure image layer's width and height are accurate
  		if (layer) {
  			layer.width = params.width;
  			layer.height = params.height;
  		}
  
  		// Only crop image if all cropping properties are given
  		if (params.sWidth !== null && params.sHeight !== null && params.sx !== null && params.sy !== null) {
  
  			// If width is not defined, use the given sWidth
  			if (params.width === null) {
  				params.width = params.sWidth;
  			}
  			// If height is not defined, use the given sHeight
  			if (params.height === null) {
  				params.height = params.sHeight;
  			}
  
  			// Optionally crop from top-left corner of region
  			if (params.cropFromCenter) {
  				params.sx += params.sWidth / 2;
  				params.sy += params.sHeight / 2;
  			}
  
  			// Ensure cropped region does not escape image boundaries
  
  			// Top
  			if ((params.sy - (params.sHeight / 2)) < 0) {
  				params.sy = (params.sHeight / 2);
  			}
  			// Bottom
  			if ((params.sy + (params.sHeight / 2)) > img.height) {
  				params.sy = img.height - (params.sHeight / 2);
  			}
  			// Left
  			if ((params.sx - (params.sWidth / 2)) < 0) {
  				params.sx = (params.sWidth / 2);
  			}
  			// Right
  			if ((params.sx + (params.sWidth / 2)) > img.width) {
  				params.sx = img.width - (params.sWidth / 2);
  			}
  
  			_transformShape(canvas, ctx, params, params.width, params.height);
  			_setGlobalProps(canvas, ctx, params);
  
  			// Draw image
  			ctx.drawImage(
  				img,
  				params.sx - (params.sWidth / 2),
  				params.sy - (params.sHeight / 2),
  				params.sWidth,
  				params.sHeight,
  				params.x - (params.width / 2),
  				params.y - (params.height / 2),
  				params.width,
  				params.height
  			);
  
  		} else {
  			// Show entire image if no crop region is defined
  
  			_transformShape(canvas, ctx, params, params.width, params.height);
  			_setGlobalProps(canvas, ctx, params);
  
  			// Draw image on canvas
  			ctx.drawImage(
  				img,
  				params.x - (params.width / 2),
  				params.y - (params.height / 2),
  				params.width,
  				params.height
  			);
  
  		}
  
  		// Draw invisible rectangle to allow for events and masking
  		ctx.beginPath();
  		ctx.rect(
  			params.x - (params.width / 2),
  			params.y - (params.height / 2),
  			params.width,
  			params.height
  		);
  		// Check for jCanvas events
  		_detectEvents(canvas, ctx, params);
  		// Close path and configure masking
  		ctx.closePath();
  		_restoreTransform(ctx, params);
  		_enableMasking(ctx, data, params);
  	}