fix(combat): resolve power spans after layout

Derive the dark middle range from live post-anchor sibling geometry instead of freezing the inherited 800-pixel prototype during controller binding. Render the user-directed bright desired-power band independently from the absolute bar-left edge to the green thumb center.

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-12 21:49:17 +02:00
parent 707add8539
commit f8c174d707
8 changed files with 129 additions and 24 deletions

View file

@ -127,4 +127,17 @@ public class UiScrollbarTests
Assert.Equal(expectedX, x, 3);
Assert.Equal(expectedWidth, width, 3);
}
[Theory]
[InlineData(0f, 6f)]
[InlineData(0.5f, 253.5f)]
[InlineData(1f, 501f)]
public void ScalarThumbFillRect_StartsAtAbsoluteLeftAndEndsAtThumbCenter(
float position, float expectedWidth)
{
var (x, width) = UiScrollbar.ScalarThumbFillRect(
totalWidth: 507f, thumbWidth: 12f, position);
Assert.Equal(0f, x, 3);
Assert.Equal(expectedWidth, width, 3);
}
}