feat(渐变合成): 完善渐变透明合成
build.yaml / build (push) Successful in 46s

This commit is contained in:
xiaoqidun committed 2026-10-05 17:11:55 +08:00
1 parent 6c14eef1ee
commit 09a49b2c26
10 files changed
+282 -25

No files matched your search

+12
View File
@@ -81,6 +81,12 @@ func (c *pdfCompositor) selectTransfer(node pdfCompositeNode, outline bool) (*pd
if style.Transfer == nil {
return nil, nil
}
if pattern := paint.Shading; pattern != nil && (node.image == nil || node.image.Image.ImageMask) {
inner := pattern.Style
if inner.Fill.Alpha != 1 || inner.SoftMask != nil || !pdfNormalBlend(inner.BlendMode) {
return nil, nil
}
}
if node.image != nil {
soft, err := node.image.Image.HasSoftMask()
if err != nil || soft {
@@ -148,6 +154,12 @@ func (p *pdfImporter) transferOpaque(node pdfCompositeNode) (bool, error) {
}
}
for i, paint := range [2]pdfgo.Paint{style.Fill, style.Stroke} {
if pattern := paint.Shading; pattern != nil && (i == 0 && fill || i == 1 && stroke) {
inner := pattern.Style
if inner.Fill.Alpha != 1 || inner.SoftMask != nil || !pdfNormalBlend(inner.BlendMode) {
return false, nil
}
}
if i == 0 && !fill || i == 1 && !stroke || paint.Tiling == nil {
continue
}