Skip to content

[6020] 修复 64 位坐标升级遗漏:失效的 set_clipping/get_shadow 重写与残留 32 位截断点 - #4717

Merged
da-liii merged 4 commits into
mainfrom
da/6020/fix
Oct 13, 2026
Merged

da-liii merged 4 commits into
mainfrom
da/6020/fix

Conversation

@da-liii

@da-liii da-liii commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

问题

#4715 将排版几何坐标升级为 64 位(SI→DI)后,code review 发现若干遗漏,其中两条影响所有尺寸的文档:

  1. PDF 导出裁剪失效:pdf_hummus_renderer_rep::set_clipping 保持 SI 签名,不再 override 已升级的基类虚函数,显示路径的裁剪全部派发到基类版本——PDF 内容流中的 q/re/W/n 裁剪算子与 clip_level 簿记完全不执行,被裁内容溢出边界。
  2. Qt 绘图模式重绘花屏:qt_proxy_renderer_rep::get_shadow / qt_shadow_renderer_rep::get_shadow 保持 SI 签名成为死代码,代理版特有的窗口后备存储像素拷贝丢失,stored 位图未被填充即被 blit 回窗口。

其余为超长文档(>2³¹ SI 单位)场景下残留的 32 位截断点。

修复

  • basic_renderer/pdf_hummus 的 set_clipping 升级为 DI(pdf 侧 to_x/to_y 同步加宽)
  • qt proxy/shadow 的 get_shadow 升级为 DI,恢复像素拷贝
  • typeset 变更区域链(editor.hpp 虚函数、edit_typeset、typesetter_rep)、apply_changes extents、update_visible、invalidate、cursor_visible、set_extents、get_typeset_content_height 的残留 SI 升级为 DI
  • 命中测试链 find_box_path/find_child/find_any_child/find_accessible_child/find_scrolled_box_path/distance/get_delta/outside 全线 SI→DI(含函数体内 xx/yy/ex1/ex2/yhi/ylo 等局部量)
  • mupdf fetch、qt_simple_widget invalidate/重绘循环、get_mouse_position、tm_button 尺寸提示的 SI 局部量升级为 DI
  • effect_point 恢复 floor(x+0.5) 舍入(原 as_int 语义),修复 (DI) 向零截断引入的行为回退
  • glue 生成器新增 di 标量类型映射(build_glue.lua),get-scroll-x/y 不再截断为 int;abs_round 增加 DI 重载;object_l1.hpp 补 TMSCM_ASSERT_DI

测试

  • xmake b stem 通过
  • rounded_text_bg_test、env_length_test、line_breaker_test、table_performance_test 全部通过

🤖 Generated with Claude Code

da-liii and others added 4 commits October 13, 2026 13:35
- pdf_hummus/basic_renderer 的 set_clipping 升级为 DI:前者不再 override 导致
  PDF 导出裁剪算子丢失(影响所有文档),后者隐藏基类 DI 版本并截断 qt 转发
- qt_proxy/qt_shadow_renderer 的 get_shadow 升级为 DI:恢复后备存储像素拷贝,
  修复绘图模式重绘花屏
- typeset 变更区域链(editor/typesetter/edit_typeset)、apply_changes extents、
  update_visible、invalidate、cursor_visible、set_extents、
  get_typeset_content_height 等编辑器侧残留 SI 截断点升级为 DI
- 命中测试链 find_box_path/find_child/find_any_child/distance/get_delta/
  outside 全线 SI→DI
- mupdf fetch、qt_simple_widget invalidate/重绘、get_mouse_position、
  tm_button 尺寸提示的 SI 局部量升级为 DI
- effect_point 恢复 floor(x+0.5) 舍入(原 as_int 语义),消除向零截断回退
- glue 生成器新增 di 标量类型映射,get-scroll-x/y 不再截断为 int;
  abs_round 增加 DI 重载,object_l1 补 TMSCM_ASSERT_DI

Co-Authored-By: Claude <[email protected]>
- lolly 新增 MAX_DI/MIN_DI,替换 DI 累加器误用的 MAX_SI/MIN_SI 哨兵
  (typeset 边界、各 find_child、composite/concat position)
- find_child 命中循环消除重复 distance 调用,先做廉价的 accessible 判断
- glue 类型 di 走 object_l1.hpp 的 typedef DI di(沿用 array_di 惯例),
  build_glue.lua 不再需要 cpp_type_map 特例;TMSCM_ASSERT_DI 改为
  TMSCM_ASSERT_INT 别名
- abs_round 改为 DI 实现 + SI 内联委派(沿用 round/inner_round 惯例),
  移除无效的 friend 声明
- edit_interface 提取 scale_extents 公共计算,去除冗余 (double) 强转
- concat_animate 的 effect_point 复用 tm_round
- pdf_hummus 的 to_x_double/to_y_double 入参升级为 DI

Co-Authored-By: Claude <[email protected]>
@da-liii
da-liii merged commit da8e406 into main Oct 13, 2026
8 checks passed
@da-liii
da-liii deleted the da/6020/fix branch October 13, 2026 07:35
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.

1 participant