refactor(重构提升): 修复裁剪并优化转换渲染
build.yaml / build (push) Successful in 47s

This commit is contained in:
xiaoqidun committed 2026-10-06 23:09:49 +08:00
1 parent 619899e297
commit e8344e6387
27 files changed
+754 -150

No files matched your search

+3 -3
View File
@@ -50,7 +50,7 @@ func (r *Renderer) renderText(ctx *canvas.Context, obj TextObject, pageH float64
if boundaryInCTM && parentCTM != nil {
objectCTM = parentCTM.Multiply(TranslationMatrix(bx, by)).Multiply(localCTM)
}
clipPath := intersectClipPath(parentClip, r.buildObjectClipPath(obj.Clips, pageH, obj.Boundary, localCTM, parentCTM, boundaryInCTM))
clipPath := r.intersectCachedClipPath(parentClip, r.buildObjectClipPath(obj.Clips, pageH, obj.Boundary, localCTM, parentCTM, boundaryInCTM))
var dp *DrawParam
if obj.DrawParam != "" {
dp = r.getDrawParam(obj.DrawParam, nil)
@@ -99,7 +99,7 @@ func (r *Renderer) renderText(ctx *canvas.Context, obj TextObject, pageH float64
}
transformShdPaint(fillPaint, parentCTM, bx, by, pageH, boundaryInCTM)
fillPaint, shadingClip, fillView := resolveShdPaint(ctx, fillPaint)
fillClip := intersectClipPath(clipPath, shadingClip)
fillClip := r.intersectCachedClipPath(clipPath, shadingClip)
var strokeStyle pathStyle
strokeClip := clipPath
strokeView := canvas.Identity
@@ -124,7 +124,7 @@ func (r *Renderer) renderText(ctx *canvas.Context, obj TextObject, pageH float64
}
transformShdPaint(strokeStyle.strokePaint, parentCTM, bx, by, pageH, boundaryInCTM)
strokeStyle.strokePaint, shadingClip, strokeView = resolveShdPaint(ctx, strokeStyle.strokePaint)
strokeClip = intersectClipPath(strokeClip, shadingClip)
strokeClip = r.intersectCachedClipPath(strokeClip, shadingClip)
}
fontStyle := canvas.FontRegular
weight := obj.Weight