feat(后端架构): 完善后端解耦
build.yaml / build (push) Successful in 39s

This commit is contained in:
xiaoqidun committed 2026-09-23 16:12:57 +08:00
1 parent 73472c5d4b
commit 77ffbe6a72
56 files changed
+2420 -1635

No files matched your search

+3 -17
View File
@@ -19,28 +19,14 @@ import (
"math"
"strconv"
"strings"
"github.com/tdewolff/canvas"
)
// Outline 获取页面坐标系中的SVG路径轮廓,不包含描边宽度和填充
// Outline 使用默认几何后端获取SVG轮廓,自定义后端使用Renderer.PathOutline
// 入参: p 路径对象
// 返回: string SVG路径数据, error 错误信息
func (p PathObject) Outline() (string, error) {
if err := creationPath(p.AbbreviatedData); err != nil {
return "", err
}
if _, err := creationBox(p.Boundary); err != nil {
return "", err
}
if p.CTM != "" {
if _, err := creationNumbers(p.CTM, 6); err != nil {
return "", err
}
}
r := &Renderer{}
path := r.buildPath(p, 0, NewMatrix(p.CTM), false)
return path.Transform(canvas.Matrix{{1, 0, 0}, {0, -1, 0}}).ToSVG(), nil
r := &Renderer{backends: defaultRenderBackends()}
return r.PathOutline(p)
}
// ShapeKind 基本图形类型