progressbar, centered percentage
This commit is contained in:
+1
-1
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user