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:
@@ -201,7 +201,9 @@ class SvgCanvas {
|
|||||||
this.curConfig.initFill.color,
|
this.curConfig.initFill.color,
|
||||||
fill_paint: null,
|
fill_paint: null,
|
||||||
fill_opacity: this.curConfig.initFill.opacity,
|
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_paint: null,
|
||||||
stroke_opacity: this.curConfig.initStroke.opacity,
|
stroke_opacity: this.curConfig.initStroke.opacity,
|
||||||
stroke_width: this.curConfig.initStroke.width,
|
stroke_width: this.curConfig.initStroke.width,
|
||||||
|
|||||||
@@ -447,7 +447,10 @@ export default {
|
|||||||
attr: {
|
attr: {
|
||||||
id: 'conn_' + svgCanvas.getNextId(),
|
id: 'conn_' + svgCanvas.getNextId(),
|
||||||
points: `${x},${y} ${x},${y} ${startX},${startY}`,
|
points: `${x},${y} ${x},${y} ${startX},${startY}`,
|
||||||
stroke: `#${initStroke.color}`,
|
stroke:
|
||||||
|
initStroke.color === 'none'
|
||||||
|
? 'none'
|
||||||
|
: `#${initStroke.color}`,
|
||||||
'stroke-width':
|
'stroke-width':
|
||||||
!startElem.stroke_width || startElem.stroke_width === 0
|
!startElem.stroke_width || startElem.stroke_width === 0
|
||||||
? initStroke.width
|
? initStroke.width
|
||||||
|
|||||||
Reference in New Issue
Block a user