fix(mobile): 修正火柴人终点位置计算

- 起点: 70 (昵称区域右边)
- 终点: containerWidth - 92 (红旗左边 - 火柴人宽度)
- 100%时火柴人右边对齐红旗左边

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-24 02:12:36 -08:00
parent 3e59d56f92
commit a823490c96
1 changed files with 7 additions and 7 deletions

View File

@ -236,13 +236,13 @@ class _StickmanRaceWidgetState extends State<StickmanRaceWidget>
final trackHeight = usableHeight / total;
final verticalPosition = rank * trackHeight + 10;
//
// (70)
// (containerWidth - 8(right) - 24() - 30())
// = + ( - ) *
//
// = (65) + (5) = 70
// = = containerWidth - 8(right) - 24(flagWidth) = containerWidth - 32
// 60 left = - 60 = containerWidth - 92
const double startX = 70.0;
final double endX = containerWidth - 62.0;
final double stickmanCenterX = startX + (endX - startX) * progress;
final double endX = containerWidth - 92.0; // left
final double stickmanLeft = startX + (endX - startX) * progress;
return AnimatedBuilder(
animation: _bounceController,
@ -287,7 +287,7 @@ class _StickmanRaceWidgetState extends State<StickmanRaceWidget>
),
//
Positioned(
left: stickmanCenterX - 30, // 60
left: stickmanLeft,
top: verticalPosition - bounce,
child: Column(
mainAxisSize: MainAxisSize.min,