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) 620 B
(function(i,n){typeof exports=="object"&&typeof module<"u"?n(require("jquery")):typeof define=="function"&&define.amd?define(["jquery"],n):(i=typeof globalThis<"u"?globalThis:i||self,n(i.$))})(this,function(i){"use strict";const n=Math.PI;i.jCanvas.extend({name:"drawDonut",type:"donut",props:{holeSize:.5},fn:function(t,e){i.jCanvas.transformShape(this,t,e),t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*n,!1),e.holeSize>0&&(t.moveTo(e.x+e.radius*e.holeSize,e.y),t.arc(e.x,e.y,e.radius*e.holeSize,0,2*n,!0)),i.jCanvas.detectEvents(this,t,e),i.jCanvas.closePath(this,t,e)}})}); //# sourceMappingURL=jcanvas-donuts.min.js.map