feat(渲染编辑): 完善渲染编辑,优化版本压缩
build.yaml / build (push) Successful in 4m25s

This commit is contained in:
xiaoqidun committed 2026-10-12 10:47:20 +08:00
1 parent 19dc79e8e3
commit a710bc5f41
68 files changed
+2149 -724

No files matched your search

+10 -12
View File
@@ -108,20 +108,14 @@ func (r *Renderer) renderText(ctx *canvas.Context, obj TextObject, pageH float64
if dp != nil {
strokeStyle.applyDrawParam(r, dp, bx, by, pageH, obj.Alpha)
}
if obj.StrokeColor != nil {
strokeStyle.applyStrokeColor(r, obj.StrokeColor, bx, by, pageH, obj.Alpha)
}
if obj.LineWidth > 0 || obj.LineWidthSet {
strokeStyle.lineWidth = obj.LineWidth
}
strokeStyle.applyLineJoin(obj.Join, obj.MiterLimit)
strokeObject := obj.pathStyle()
strokeObject.FillColor = nil
strokeStyle.applyPathObject(r, strokeObject, bx, by, pageH)
if strokeStyle.strokePaint == nil {
strokeStyle.strokePaint = canvas.Transparent
}
strokeStyle.scale(ctm)
if strokeStyle.lineWidth == 0 {
strokeStyle.lineWidth = 25.4 / r.DPI
}
strokeStyle.lineWidth = r.deviceLineWidth(strokeStyle.lineWidth)
transformShdPaint(strokeStyle.strokePaint, parentCTM, bx, by, pageH, boundaryInCTM)
strokeStyle.strokePaint, shadingClip, strokeView = resolveShdPaint(ctx, strokeStyle.strokePaint)
strokeClip = r.intersectCachedClipPath(strokeClip, shadingClip)
@@ -220,8 +214,12 @@ func (r *Renderer) renderText(ctx *canvas.Context, obj TextObject, pageH float64
}
codePos := 0
textPos := 0
for index, tc := range obj.TextCode {
if textRun != nil && obj.textCodeLineBreak(index) {
var lines textLineScanner
if textRun != nil {
lines = newTextLineScanner(obj)
}
for _, tc := range obj.TextCode {
if textRun != nil && lines.next(tc) {
textPos++
}
var runes []rune