feat(编辑阅读): 完善保真编辑与跨文档复制,优化后端缓存和大文件性能
build.yaml / build (push) Successful in 41s

This commit is contained in:
xiaoqidun committed 2026-09-24 13:48:48 +08:00
1 parent 06b5df9173
commit 697a059162
18 files changed
+694 -130

No files matched your search

+6 -8
View File
@@ -293,20 +293,18 @@ func validateTextGlyphs(obj TextObject, glyphCount uint16) error {
total += len(textCodeRunes(code.Value))
ends = append(ends, total)
}
previous := 0
previous, boundary := 0, 0
for _, transform := range obj.CGTransform {
start, count := transform.CodePosition, transform.CodeCount
if start < previous || count <= 0 || start >= total || count > total-start {
return fmt.Errorf("invalid glyph character range")
}
end := start + count
for _, boundary := range ends {
if start < boundary {
if end > boundary {
return fmt.Errorf("glyph mapping crosses text codes")
}
break
}
for ends[boundary] <= start {
boundary++
}
if end > ends[boundary] {
return fmt.Errorf("glyph mapping crosses text codes")
}
ids := strings.Fields(transform.Glyphs)
if len(ids) == 0 || len(ids) != transform.GlyphCount {