Skip to content

[0116] text-bg-color 改为在 concat_box 层级统一绘制圆角背景#3345

Merged
da-liii merged 3 commits into
mainfrom
da/0116/substack
May 14, 2026
Merged

[0116] text-bg-color 改为在 concat_box 层级统一绘制圆角背景#3345
da-liii merged 3 commits into
mainfrom
da/0116/substack

Conversation

@da-liii
Copy link
Copy Markdown
Contributor

@da-liii da-liii commented May 14, 2026

Summary

将 text-bg-color 路径下的文本背景色从逐 text_box 直角矩形绘制,改为在 concat_box 层级统一绘制完整圆角矩形。

Changes

  • box_rep 新增 get_bg_color() / set_bg_color() 虚方法
  • text_box_rep 重写以暴露内部 bg_color
  • concat_box_rep 新增 pre_display() / post_display()
    • 扫描子 TEXT_BOX,归并连续且背景色相同的片段
    • 计算联合 bounding box,以字体高度为基准计算圆角半径
    • ren->polygon() 填充圆角背景
    • 临时将子 box bg_color 设为透明,避免重复绘制
  • 新增 rounded_text_bg_test 单元测试

Test plan

  • xmake run rounded_text_bg_test 全部通过
  • xmake build stem 编译通过

🤖 Generated with Claude Code

da-liii and others added 2 commits May 13, 2026 20:45
- box_rep 新增 get_bg_color/set_bg_color 虚方法
- text_box_rep 重写以暴露 bg_color
- concat_box_rep 新增 pre_display/post_display,统一扫描连续背景色片段并绘制圆角矩形
- 新增 rounded_text_bg_test 单元测试

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@MoonL79 MoonL79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@da-liii da-liii merged commit 27d5d64 into main May 14, 2026
5 checks passed
@da-liii da-liii deleted the da/0116/substack branch May 14, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants