fix(svgcanvas): Handle 'none' stroke color in SVG elements (#1084)

This update modifies the stroke color handling in both the SvgCanvas and ext-connector modules. When the stroke color is set to 'none', it now correctly assigns an empty string or 'none' instead of a hex value, ensuring proper rendering of SVG elements without strokes.
This commit is contained in:
shanyue
2026-03-16 23:08:34 +08:00
committed by GitHub
parent 173dd2607a
commit 7c6085e7b9
2 changed files with 7 additions and 2 deletions

View File

@@ -201,7 +201,9 @@ class SvgCanvas {
this.curConfig.initFill.color,
fill_paint: null,
fill_opacity: this.curConfig.initFill.opacity,
stroke: `#${this.curConfig.initStroke.color}`,
stroke:
(this.curConfig.initStroke.color === 'none' ? '' : '#') +
this.curConfig.initStroke.color,
stroke_paint: null,
stroke_opacity: this.curConfig.initStroke.opacity,
stroke_width: this.curConfig.initStroke.width,