fix: canvas ctx.font uses NEXT ART font
This commit is contained in:
@@ -125,13 +125,13 @@ function draw(cur,max){
|
||||
ctx.beginPath();ctx.moveTo(sx+mr*Math.cos(a),sy+mr*Math.sin(a));ctx.lineTo(sx+pr*Math.cos(a),sy+pr*Math.sin(a));
|
||||
ctx.strokeStyle=r>=rl?'rgba(255,255,255,.15)':'rgba(255,255,255,.08)';
|
||||
ctx.lineWidth=r%4000===0?2.5:1;ctx.stroke();
|
||||
if(r%4000===0){ctx.fillStyle='rgba(255,255,255,.22)';ctx.font=`${Math.max(13,W/38)|0}px sans-serif`;ctx.textAlign='center';ctx.fillText(Math.round(r/1000),sx+(pr+22)*Math.cos(a),sy+(pr+22)*Math.sin(a)+5)}
|
||||
if(r%4000===0){ctx.fillStyle='rgba(255,255,255,.22)';ctx.font=`${Math.max(13,W/38)|0}px 'NEXT ART',sans-serif`;ctx.textAlign='center';ctx.fillText(Math.round(r/1000),sx+(pr+22)*Math.cos(a),sy+(pr+22)*Math.sin(a)+5)}
|
||||
}
|
||||
|
||||
// RPM number
|
||||
ctx.fillStyle='#fff';ctx.font=`200 ${Math.max(48,W/12)|0}px sans-serif`;ctx.textAlign='center';
|
||||
ctx.fillStyle='#fff';ctx.font=`200 ${Math.max(48,W/12)|0}px 'NEXT ART',sans-serif`;ctx.textAlign='center';
|
||||
ctx.fillText(Math.round(cur).toLocaleString(),sx,sy-180);
|
||||
ctx.fillStyle='rgba(255,255,255,.12)';ctx.font=`${Math.max(12,W/44)|0}px sans-serif`;
|
||||
ctx.fillStyle='rgba(255,255,255,.12)';ctx.font=`${Math.max(12,W/44)|0}px 'NEXT ART',sans-serif`;
|
||||
ctx.fillText('\u00d71000 rpm',sx,sy-155);
|
||||
|
||||
// redline
|
||||
|
||||
Reference in New Issue
Block a user