UNPKG

jcanvas

Version:

jCanvas brings jQuery's powerful syntax and capability to the HTML5 canvas. Quickly create canvas-based apps that can utilize layers, animations, events, and much more. jCanvas works on all modern browsers and platforms, including iOS and Android.

3 lines (2 loc) 438 B
import r from"jquery";const i=Math.PI;r.jCanvas.extend({name:"drawHeart",type:"heart",props:{size:0},fn:function(a,t){const c=this,s=t.size,e=.75,o=s*e,v=i*(e*(1-e));r.jCanvas.transformShape(c,a,t,s,o);const n=t.x,h=t.y+s/8;a.beginPath(),a.moveTo(n,h+o/2),a.arc(n+s/4,h-o/2,s/4,v,i,!0),a.arc(n-s/4,h-o/2,s/4,0,i-v,!0),t.closed=!0,r.jCanvas.detectEvents(c,a,t),r.jCanvas.closePath(c,a,t)}}); //# sourceMappingURL=jcanvas-hearts.min.js.map