/** * @license jCanvas Handles v15.09.25 * Copyright 2015 Caleb Evans * Released under the MIT license */ !function($){function e(e){var n=e._method;return n===$.fn.drawRect||n===$.fn.drawEllipse||n===$.fn.drawImage}function n(e){var n=e._method;return n===$.fn.drawLine||n===$.fn.drawQuadratic||n===$.fn.drawBezier}function t(e,n,t,r){var a=$.extend({cursors:{mouseover:"grab",mousedown:"grabbing",mouseup:"grab"}},n.handle,{layer:!0,draggable:!0,x:n[t],y:n[r],_parent:n,_xProp:t,_yProp:r,fromCenter:!0,dragstart:function(e){$(this).triggerLayerEvent(e._parent,"handlestart")},drag:function(e){var n=e._parent;n[e._xProp]=e.x-n.x,n[e._yProp]=e.y-n.y,o(n),$(this).triggerLayerEvent(n,"handlemove")},dragstop:function(e){$(this).triggerLayerEvent(e._parent,"handlestop")},dragcancel:function(e){$(this).triggerLayerEvent(e._parent,"handlecancel")}});e.draw(a),n._handles.push(e.getLayer(-1))}function r(e,n,t,r){var a,i;-1===t&&-1===r||1===t&&1===r?i="nwse-resize":0!==t||-1!==r&&1!==r?-1!==t&&1!==t||0!==r?(1===t&&-1===r||-1===t&&1===r)&&(i="nesw-resize"):i="ew-resize":i="ns-resize",a=$.extend({cursors:{mouseover:i}},n.handle,{layer:!0,draggable:!0,x:n.x+(t*n.width/2+(n.fromCenter?0:n.width/2)),y:n.y+(r*n.height/2+(n.fromCenter?0:n.height/2)),_parent:n,_px:t,_py:r,fromCenter:!0,dragstart:function(e){$(this).triggerLayerEvent(e._parent,"handlestart")},drag:function(e){var n=e._parent;n.width+e.dx*e._px