feat(D.2b): factory propagates ReadOrder→ZOrder for faithful draw layering
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7e56eff884
commit
e8ddb68801
2 changed files with 13 additions and 1 deletions
|
|
@ -63,6 +63,9 @@ public static class DatWidgetFactory
|
|||
e.Width = info.Width;
|
||||
e.Height = info.Height;
|
||||
|
||||
// Honor the dat's draw order so overlapping pieces (grip overlay over bevel chrome) layer correctly.
|
||||
e.ZOrder = (int)info.ReadOrder;
|
||||
|
||||
// Map the four raw edge-anchor values to the AnchorEdges bit-flag that the
|
||||
// UI layout engine uses for reflow.
|
||||
e.Anchors = ElementReader.ToAnchors(info.Left, info.Top, info.Right, info.Bottom);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,16 @@ public class DatWidgetFactoryTests
|
|||
Assert.Equal(AnchorEdges.Left | AnchorEdges.Top | AnchorEdges.Right, e.Anchors);
|
||||
}
|
||||
|
||||
// ── Test 5: Meter slice extraction (the important one) ───────────────────
|
||||
// ── Test 5: ReadOrder propagated to ZOrder ───────────────────────────────
|
||||
|
||||
[Fact]
|
||||
public void Create_PropagatesReadOrderToZOrder()
|
||||
{
|
||||
var e = DatWidgetFactory.Create(new ElementInfo { Type = 3, ReadOrder = 7 }, NoTex, null);
|
||||
Assert.Equal(7, e!.ZOrder);
|
||||
}
|
||||
|
||||
// ── Test 6: Meter slice extraction (the important one) ───────────────────
|
||||
|
||||
/// <summary>
|
||||
/// A meter (Type 7) whose two Type-3 containers each carry 3 image children
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue