feat(渲染编辑): 规范文字定位与注解度量
build.yaml / build (push) Successful in 48s

This commit is contained in:
xiaoqidun committed 2026-10-09 21:45:07 +08:00
1 parent 9b38f6f039
commit 444c01b976
6 files changed
+42 -42

No files matched your search

+2 -6
View File
@@ -171,15 +171,11 @@ func (r *Renderer) PositionText(object TextObject, state RenderState) (*Position
if err != nil {
return nil, err
}
positioner := NewTextPositioner(code, object.ReadDirection)
positioner := NewTextPositioner(code)
for i, gid := range ids {
path := paths[i]
width := float64(metrics.GlyphAdvance(gid)) * unit
advance := width * horizontal
if (object.ReadDirection-object.CharDirection)%180 != 0 {
advance = size
}
origin := positioner.Next(advance)
origin := positioner.Next()
scaleX := horizontal
if bold && len(path) > 0 {
outline, err := geometry.Stroke(path, StrokeOptions{Width: size * 0.04, Join: "Round", Cap: "Round"})