(tracking, width, height)
| 373 | } |
| 374 | |
| 375 | drawProgressBars(tracking, width, height) { |
| 376 | const ctx = this.ctx; |
| 377 | const barWidth = width * 0.25; |
| 378 | const barHeight = 12; |
| 379 | const x = 20; |
| 380 | const y = height - 80; |
| 381 | |
| 382 | // 对齐进度条 |
| 383 | this.drawProgressBar( |
| 384 | x, y - 30, |
| 385 | barWidth, barHeight, |
| 386 | tracking.align_score || 0, |
| 387 | '对齐 Alignment', |
| 388 | this.colors.primary |
| 389 | ); |
| 390 | |
| 391 | // 距离进度条 |
| 392 | this.drawProgressBar( |
| 393 | x, y, |
| 394 | barWidth, barHeight, |
| 395 | tracking.range_score || 0, |
| 396 | `距离 Distance (≈1)`, |
| 397 | this.colors.secondary |
| 398 | ); |
| 399 | |
| 400 | // 显示比率 |
| 401 | if (tracking.ratio !== null && tracking.ratio !== undefined) { |
| 402 | ctx.font = this.fonts.small; |
| 403 | ctx.fillStyle = this.colors.text; |
| 404 | ctx.fillText( |
| 405 | `面积比 Ratio: ${tracking.ratio.toFixed(2)}`, |
| 406 | x + barWidth + 20, |
| 407 | y + 8 |
| 408 | ); |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | drawProgressBar(x, y, width, height, value, label, color) { |
| 413 | const ctx = this.ctx; |
no test coverage detected