feat(编辑能力): 修复复合对象裁剪丢失,优化选区性能
build.yaml / build (push) Successful in 38s

This commit is contained in:
xiaoqidun committed 2026-09-17 11:51:28 +08:00
1 parent 2cc6c121f8
commit 7f79d1e70a
18 files changed
+757 -129

No files matched your search

+13 -3
View File
@@ -16,6 +16,7 @@ package ofdgo
import (
"fmt"
"image/color"
"strings"
"github.com/go-text/typesetting/segmenter"
@@ -125,10 +126,19 @@ func (e *Editor) styleTextObjects(objects []GraphicObject, style TextStyle) ([]G
}
}
if style.Color != "" {
if text.FillColor == nil {
text.FillColor = &FillColor{}
if err := creationColor(&FillColor{Value: style.Color}); err != nil {
return nil, err
}
text.FillColor.Value = style.Color
var r, g, b float64
fmt.Sscan(style.Color, &r, &g, &b)
value, err := e.RGBColor(color.NRGBA{R: uint8(r), G: uint8(g), B: uint8(b), A: 255})
if err != nil {
return nil, err
}
if text.FillColor != nil {
value.Alpha = text.FillColor.Alpha
}
text.FillColor = value
}
}
return updates, nil