From d1e06fa8dc626b6d5e848b9fea12665b12f3cac1 Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 9 Aug 2018 18:41:33 -0300 Subject: Cleanup --- index.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'index.js') 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 -- cgit 1.3.0-6-gf8a5