Add PAGX auto layout system with constraint layout, flex container, and CLI tooling#3363
Merged
Add PAGX auto layout system with constraint layout, flex container, and CLI tooling#3363
Conversation
…w TextLayout API.
…chor center regression.
…n pipeline and defer TextBlob generation to render phase.
…ate round-trip decomposition.
…applyLayout public.
…ions in measuring constrained elements.
…rtical centering.
…eration to render phase.
…updated test icon.
…irst-child Group lint.
…ementsWithMatrices.
shlzxjp
reviewed
Apr 9, 2026
src/cli/CommandLayout.cpp
Outdated
| // Data Structures | ||
| // ============================================================================ | ||
|
|
||
| struct LCRect { |
src/pagx/PAGXExporter.cpp
Outdated
| @@ -279,6 +296,14 @@ static std::string pointListToString(const std::vector<Point>& points) { | |||
| return result; | |||
| } | |||
|
|
|||
| static bool shouldSkipPosition(const Point& position, const Point& defaultPos, float left, | |||
Collaborator
There was a problem hiding this comment.
AI没遵守函数命名规范
函数参数按照left、top、right、bottom、centerX、centerY排列更符合习惯
src/pagx/PAGXImporter.cpp
Outdated
| @@ -152,6 +178,45 @@ static ColorMatrixFilter* parseColorMatrixFilter(const DOMNode* node, PAGXDocume | |||
| // Custom data parsing | |||
| //============================================================================== | |||
|
|
|||
| static void serializeDOMNode(const DOMNode* node, std::string& output) { | |||
| case TextAlign::Start: | ||
| break; | ||
| case TextAlign::Center: | ||
| anchorX = -maxLineWidth / 2; |
Collaborator
There was a problem hiding this comment.
这里的设计是只考虑水平方向,暂时不管垂直方向吗?如果文本是沿任意路径排版的,anchor如何计算
Collaborator
Author
There was a problem hiding this comment.
TextAlign的定义是行内对齐。垂直方向排版的时候maxLineWidth就是竖的
Hparty
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为 PAGX 格式引入完整的自动布局系统,包括: