progressbar, centered percentage

Nathan DECHER 5 years ago
parent c850d9ffa9
commit 7d97132aa1
  1. 2
      src/js/progress.js

@ -34,7 +34,7 @@ class ProgressBar {
ctx.fillRect(0, 0, canvas.width*this.completeCount/this.taskCount, canvas.height); ctx.fillRect(0, 0, canvas.width*this.completeCount/this.taskCount, canvas.height);
ctx.fillStyle=textColor; ctx.fillStyle=textColor;
ctx.textAlign='center'; ctx.textAlign='center';
ctx.textBaseline='center'; ctx.textBaseline='middle';
ctx.font=`${canvas.height/2}px 'Fira Code'`; ctx.font=`${canvas.height/2}px 'Fira Code'`;
ctx.fillText(this.percent+'%', canvas.width/2, canvas.height/2); ctx.fillText(this.percent+'%', canvas.width/2, canvas.height/2);
} }

Loading…
Cancel
Save