paint(g: Canvas ,x:number,y:number,w:number,h:number,d:number) { g.beginPath(); g.fillStyle = this.color1; g.arc(Math.floor(x + w/2), Math.floor(y + h/2) , Math.floor(w/3 - 0.5), 0, 2* Math.PI, 1, false); g.fill(); g.beginPath(); g.fillStyle = this.color2; g.arc(Math.floor(x + w/2), Math.floor(y + h/2) , Math.floor(w/4 - 0.5), 0, 2* Math.PI, 1, false); g.fill(); }
paint(g: Canvas ,x:number,y:number,w:number,h:number,d:number) { g.beginPath(); g.strokeStyle = this.color; g.lineWidth = 2; g.moveTo(x + 1, y + 2); g.lineTo(x + w - 3, y + h - 3); g.stroke(); g.beginPath(); g.moveTo(x + w - 2, y + 2); g.lineTo(x + 2, y + h - 2); g.stroke(); g.lineWidth = 1; }
paint(g: Canvas ,x:number,y:number,w:number,h:number,d:number) { g.beginPath(); if (this.direction === "vertical") { var r = w/2; g.arc(x + r, y + r, r, Math.PI, 0, false); g.lineTo(x + w, y + h - r); g.arc(x + r, y + h - r, r, 0, Math.PI, false); g.lineTo(x, y + r); } else { var r = h/2; g.arc(x + r, y + r, r, 0.5 * Math.PI, 1.5 * Math.PI, false); g.lineTo(x + w - r, y); g.arc(x + w - r, y + h - r, r, 1.5*Math.PI, 0.5*Math.PI, false); g.lineTo(x + r, y + h); } g.setColor(this.color); g.fill(); }