progressbar, centered percentage

This commit is contained in:
Nathan DECHER 2020-04-14 16:26:22 +02:00
parent c850d9ffa9
commit 7d97132aa1

View file

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