feat(转换能力): 完善可编辑矢量转换与零线宽保存
build.yaml / build (push) Successful in 46s

This commit is contained in:
xiaoqidun committed 2026-09-24 19:12:58 +08:00
1 parent 444a84c629
commit b30a44b7ce
25 files changed
+529 -63

No files matched your search

+6 -3
View File
@@ -260,7 +260,7 @@ func (c *semanticCompiler) objectStyle(object PathObject, defaults *DrawParam, l
if defaults != nil {
style.fill = defaults.FillColor
style.stroke = (*FillColor)(defaults.StrokeColor)
if defaults.LineWidth > 0 {
if defaults.LineWidth > 0 || defaults.LineWidthSet {
style.options.Width = defaults.LineWidth
}
if defaults.Cap != "" {
@@ -283,7 +283,7 @@ func (c *semanticCompiler) objectStyle(object PathObject, defaults *DrawParam, l
if object.StrokeColor != nil {
style.stroke = (*FillColor)(object.StrokeColor)
}
if object.LineWidth > 0 {
if object.LineWidth > 0 || object.LineWidthSet {
style.options.Width = object.LineWidth
}
if object.Cap != "" {
@@ -313,6 +313,9 @@ func (c *semanticCompiler) objectStyle(object PathObject, defaults *DrawParam, l
style.options.Dashes[i] *= scale
}
}
if style.options.Width == 0 {
style.options.Width = 25.4 / c.renderer.DPI
}
return style
}
@@ -389,7 +392,7 @@ func (c *semanticCompiler) textObject(object TextObject, state RenderState) erro
return nil
}
_, linear := renderObjectMatrix(object.Boundary, NewMatrix(object.CTM), state)
style := c.objectStyle(PathObject{DrawParam: object.DrawParam, FillColor: object.FillColor, StrokeColor: object.StrokeColor, Alpha: object.Alpha, LineWidth: object.LineWidth, Join: object.Join, MiterLimit: object.MiterLimit}, state.Defaults, linear)
style := c.objectStyle(PathObject{DrawParam: object.DrawParam, FillColor: object.FillColor, StrokeColor: object.StrokeColor, Alpha: object.Alpha, LineWidth: object.LineWidth, LineWidthSet: object.LineWidthSet, Join: object.Join, MiterLimit: object.MiterLimit}, state.Defaults, linear)
if style.fill == nil {
style.fill = withFillAlpha(&FillColor{}, object.Alpha)
}