Skip to content

Conversation

imsunhao
Copy link
Contributor

🤔 这个分支是...

  • 重构
  • 代码优化
  • Ts 类型更新

🔗 相关 issue 连接

💡 问题的背景&解决方案

背景:
原先 toBoxArray 函数在处理不同长度的数组输入时,逻辑分支较多且返回结构不统一。注释内标注的方向(top/right/bottom/left)存在重复与潜在歧义,且未对类型进行统一定义。

解决方案:

  • 新增 BoxTuple<T> 类型,明确返回结构 [top, right, bottom, left]
  • 精简数组长度判断逻辑,去除多余注释;
  • 保留兼容性处理(1~3长度数组自动补全);
  • 改善类型安全与可读性,避免隐式引用修改问题。
image

📝 Changelog

Language Changelog
🇺🇸 English Refactored toBoxArray logic and introduced BoxTuple<T> type for consistent tuple return. Simplified array handling and improved readability.
🇨🇳 Chinese 重构 toBoxArray 函数逻辑,引入 BoxTuple<T> 类型以统一返回格式,简化分支逻辑并提升可读性。

☑️ 自测

  • 文档不需要更新(纯内部逻辑调整)
  • Demo 不需要更新
  • Ts 类型定义已更新
  • Changelog 已提供

🚀 Summary

copilot:summary

🔍 Walkthrough

copilot:walkthrough

@fangsmile fangsmile merged commit fe9edb4 into VisActor:develop Oct 21, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants