#5574 Fixed issue linkStyles

This commit is contained in:
Knut Sveidqvist 2024-12-17 16:28:38 +01:00
parent 9b00f1f2fb
commit c153d0455f
2 changed files with 3 additions and 6 deletions

View File

@ -297,9 +297,6 @@ export const updateLink = function (positions: ('default' | number)[], style: st
if (pos === 'default') {
edges.defaultStyle = style;
} else {
// if (utils.isSubstringInArray('fill', style) === -1) {
// style.push('fill:none');
// }
edges[pos].style = style;
// if edges[pos].style does have fill not set, set it to none
if (

View File

@ -429,7 +429,6 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
let pointsHasChanged = false;
const tail = startNode;
var head = endNode;
const edgeClassStyles = [];
for (const key in edge.cssCompiledStyles) {
if (isLabelStyle(key)) {
@ -510,6 +509,7 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
let svgPath;
let linePath = lineFunction(lineData);
const edgeStyles = Array.isArray(edge.style) ? edge.style : [edge.style];
if (edge.look === 'handDrawn') {
const rc = rough.svg(elem);
Object.assign([], lineData);
@ -531,7 +531,7 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
elem.node().appendChild(svgPath.node());
} else {
const stylesFromClasses = edgeClassStyles.join(';');
const styles = edge.edgeStyles ? edgeStyles.reduce((acc, style) => acc + ';' + style, '') : '';
const styles = edgeStyles ? edgeStyles.reduce((acc, style) => acc + style + ';', '') : '';
let animationClass = '';
if (edge.animate) {
animationClass = ' edge-animation-fast';
@ -550,7 +550,7 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
(edge.classes ? ' ' + edge.classes : '') +
(animationClass ? animationClass : '')
)
.attr('style', stylesFromClasses + ';' + styles);
.attr('style', stylesFromClasses ? stylesFromClasses + ';' + styles + ';' : styles);
}
// DEBUG code, DO NOT REMOVE