From f2f9565436e25b6bf465361326f3f5697146145a Mon Sep 17 00:00:00 2001 From: AskaEth Date: Sat, 25 Jul 2026 17:46:32 +0800 Subject: [PATCH] fix: arc scale marks use same path-distance angle as progress --- dashboards/forza_composite/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboards/forza_composite/index.html b/dashboards/forza_composite/index.html index f58b9e4..3bd8aa5 100644 --- a/dashboards/forza_composite/index.html +++ b/dashboards/forza_composite/index.html @@ -133,15 +133,15 @@ function draw(cur,max){ // scale marks along TOTAL path (arc + line) const mr=sr-gw/2-6,pr=sr+gw/2+6; for(let r=0;r<=max;r+=2000){ - const t=r/max,p=pathPt(t); - if(r*totalLen/max<=arcLen){ - const a=d2r(As+(Ae-As)*t); + const t=r/max,ad=t*totalLen; + if(ad<=arcLen){ + const a=d2r(As+(Ae-As)*(ad/arcLen)); 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 '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)} }else{ - // on line portion: vertical marks + const p=pathPt(t); ctx.beginPath();ctx.moveTo(p.x,ey-gw/2-4);ctx.lineTo(p.x,ey+gw/2+4); ctx.strokeStyle=r>=rl?'rgba(255,255,255,.15)':'rgba(255,255,255,.08)'; ctx.lineWidth=r%4000===0?2.5:1;ctx.stroke();