Files
XCEngine/docs/used/XCUI_Subplan-02_LayoutEngine_完成归档_2026-04-04.md

51 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# XCUI Subplan 02Layout Engine 完成归档
归档日期:
- `2026-04-04`
原始来源:
- [../XCUI完整架构设计与执行计划.md](../XCUI完整架构设计与执行计划.md)
本次完成范围:
- 落地 XCUI 纯算法布局基础类型:
- `UILayoutLength`
- `UILayoutConstraints`
- `UILayoutThickness`
- `UILayoutItem`
- `UIStackLayoutOptions`
- `UIOverlayLayoutOptions`
- 落地 measure / arrange 双阶段布局算法
- 实现 `Horizontal Stack` / `Vertical Stack` / `Overlay` 三类 MVP 容器
- 支持 `px / content / stretch`
- 支持 `padding / spacing / margin / min / max / alignment`
- 建立独立 `ui_tests` 测试目标并通过验证
实际代码落点:
- [engine/include/XCEngine/UI/Types.h](D:/Xuanchi/Main/XCEngine/engine/include/XCEngine/UI/Types.h)
- [engine/include/XCEngine/UI/Layout/LayoutTypes.h](D:/Xuanchi/Main/XCEngine/engine/include/XCEngine/UI/Layout/LayoutTypes.h)
- [engine/include/XCEngine/UI/Layout/LayoutEngine.h](D:/Xuanchi/Main/XCEngine/engine/include/XCEngine/UI/Layout/LayoutEngine.h)
- [tests/Core/Math/CMakeLists.txt](D:/Xuanchi/Main/XCEngine/tests/Core/Math/CMakeLists.txt)
- [tests/Core/Math/test_ui_layout.cpp](D:/Xuanchi/Main/XCEngine/tests/Core/Math/test_ui_layout.cpp)
验证结果:
- `cmake --build . --config Debug --target math_tests -- /m:1`
- `ctest -C Debug --test-dir D:\\Xuanchi\\Main\\XCEngine\\build\\tests\\Core\\Math --output-on-failure -R UI_Layout`
- 结果:`5/5 UI_Layout tests passed`
与原子计划相比,当前仍未覆盖:
- `Scroll` 容器
- 更复杂的主轴分布策略
- 与 XCUI tree/state 的正式对接
- 文本测量与真实控件树集成
建议后续承接:
-`Subplan-01` 提供 tree / node / invalidation 契约后,把当前布局算法接入正式 UI tree
- 后续再补 `Scroll`、更完整容器族、文本测量桥接