diff options
-rw-r--r-- | index.js | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/index.js b/index.js index ddf289b..00810ba 100644 --- a/index.js +++ b/index.js @@ -10,7 +10,7 @@ class ATBBar { this.segmentCount = 6 this.queuedActions = [] - // Draw + // Drawing this.canvas = document.createElement('canvas') this.canvas.width = 200 @@ -20,20 +20,6 @@ class ATBBar { draw() { const ctx = this.canvas.getContext('2d') ctx.clearRect(0, 0, this.canvas.width, this.canvas.height) - - /* - ctx.fillStyle = 'rgba(0, 0, 0, 1)' - ctx.fillRect(0, 0, this.canvas.width * this.progress, this.canvas.height) - - ctx.globalCompositeOperation = 'source-in' - ctx.fillStyle = 'blue' - ctx.fillRect(1, 1, this.canvas.width - 2, this.canvas.height - 2) - - ctx.globalCompositeOperation = 'source-over' - ctx.strokeStyle = '#000' - ctx.strokeRect(0.5, 0.5, this.canvas.width - 0.5, this.canvas.height - 0.5) - */ - ctx.save() ctx.beginPath() @@ -45,7 +31,7 @@ class ATBBar { ctx.restore() ctx.strokeStyle = '#000' - ctx.strokeRect(0.5, 0.5, this.canvas.width - 0.5, this.canvas.height - 0.5) + ctx.strokeRect(0.5, 0.5, this.canvas.width - 1, this.canvas.height - 1) const segmentWidth = this.canvas.width / this.segmentCount |