feat(渲染编辑): 完善渲染编辑验签并优化性能
build.yaml / build (push) Successful in 45s

This commit is contained in:
xiaoqidun committed 2026-10-02 13:08:34 +08:00
1 parent 9c5ce1d66f
commit ac198f3351
56 files changed
+3029 -825

No files matched your search

+7 -2
View File
@@ -216,9 +216,10 @@ func (line geometryPolyline) dash(pattern []float64, total, offset float64) ([]g
remaining := pattern[index] - phase
var result []geometryPolyline
var run []Point
var direction Point
flush := func() {
if len(run) != 0 {
result = append(result, geometryPolyline{points: run})
result = append(result, geometryPolyline{points: run, direction: direction})
run = nil
}
}
@@ -255,8 +256,12 @@ func (line geometryPolyline) dash(pattern []float64, total, offset float64) ([]g
if index%2 == 0 {
if len(run) == 0 {
run = append(run, geometryLerp(a, b, at/length))
direction = Point{(b.X - a.X) / length, (b.Y - a.Y) / length}
}
end := geometryLerp(a, b, (at+step)/length)
if end != run[len(run)-1] {
run = append(run, end)
}
run = append(run, geometryLerp(a, b, (at+step)/length))
}
at += step
remaining -= step