mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-08-30 12:12:40 +08:00
feat(横线渲染): 修复横线渲染
This commit is contained in:
+17
-1
@@ -15,10 +15,10 @@
|
||||
package ofdgo
|
||||
|
||||
import (
|
||||
"github.com/tdewolff/canvas"
|
||||
"image/color"
|
||||
"strconv"
|
||||
"strings"
|
||||
"github.com/tdewolff/canvas"
|
||||
)
|
||||
|
||||
// parseColor 解析颜色字符串
|
||||
@@ -88,6 +88,22 @@ func parseStrokeColor(strokeColor *StrokeColor) color.Color {
|
||||
return parseAxialShdColor(strokeColor.AxialShd, strokeColor.Alpha)
|
||||
}
|
||||
|
||||
// parseStrokePaint 解析勾边画刷
|
||||
// 入参: strokeColor 勾边颜色节点, x X坐标, y Y坐标, pageH 页面高度, originX 原点X坐标, originY 原点Y坐标
|
||||
// 返回: any 勾边画刷
|
||||
func parseStrokePaint(strokeColor *StrokeColor, x, y, pageH, originX, originY float64) any {
|
||||
if strokeColor == nil {
|
||||
return nil
|
||||
}
|
||||
if strings.TrimSpace(strokeColor.Value) != "" {
|
||||
return parseColorWithAlpha(strokeColor.Value, strokeColor.Alpha)
|
||||
}
|
||||
if gradient := parseAxialShdGradient(strokeColor.AxialShd, strokeColor.Alpha, x, y, pageH, originX, originY); gradient != nil {
|
||||
return gradient
|
||||
}
|
||||
return parseAxialShdColor(strokeColor.AxialShd, strokeColor.Alpha)
|
||||
}
|
||||
|
||||
// parseAxialShdColor 解析轴向渐变颜色
|
||||
// 入参: axialShd 轴向渐变节点, alpha 透明度
|
||||
// 返回: color.Color 颜色对象
|
||||
|
||||
Reference in New Issue
Block a user