fix(combat): preserve authored meter child geometry

Carry the consumed dark-range child's own retail edge policy into the procedural scrollbar, widening it to the authored post-reflow interval without covering the rendered labels. Restore the bright layer to live attack-charge feedback across the full bar from the left.

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-12 21:57:53 +02:00
parent f8c174d707
commit e671b8a5c4
10 changed files with 66 additions and 105 deletions

View file

@ -50,9 +50,7 @@ public sealed class CombatUiControllerTests
high.OnEvent(new UiEvent(0, high, UiEventType.MouseDown, Data1: 2, Data2: 2));
now = 4.5d;
Assert.True(power.ScalarFillFollowsThumb);
var range = Assert.IsType<Func<(float Left, float Width)>>(power.ScalarRangeProvider);
Assert.Equal((104f, 299f), range());
Assert.Equal(0.5f, power.ScalarFill()!.Value, 3);
high.OnEvent(new UiEvent(0, high, UiEventType.MouseUp, Data1: 2, Data2: 2));
var attack = Assert.Single(sent);
@ -98,10 +96,6 @@ public sealed class CombatUiControllerTests
Assert.False(speed.RightAligned);
Assert.False(powerLabel.Centered);
Assert.True(powerLabel.RightAligned);
var range = Assert.IsType<Func<(float Left, float Width)>>(power.ScalarRangeProvider);
var (left, width) = range();
Assert.Equal(speed.Left + speed.Width - power.Left, left, 3);
Assert.Equal(powerLabel.Left - power.Left - left, width, 3);
}
[Fact]
@ -120,8 +114,7 @@ public sealed class CombatUiControllerTests
var power = Assert.IsType<UiScrollbar>(
layout.FindElement(CombatUiController.PowerControlId));
var range = Assert.IsType<Func<(float Left, float Width)>>(power.ScalarRangeProvider);
Assert.Equal((104f, 299f), range());
Assert.Equal((50f, 407f), power.ScalarRangeRect());
}
private static readonly CombatUiLabels Labels = new(