Fix for multi-line row issue and failsafe for edge style for stroke not present

This commit is contained in:
Ashish Jain
2025-03-13 00:28:03 +01:00
parent 3848649bdd
commit 292cd83439
2 changed files with 5 additions and 1 deletions

View File

@@ -521,7 +521,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];
let strokeColor = edgeStyles.find((style) => style.startsWith('stroke:'));
let strokeColor = edgeStyles.find((style) => style?.startsWith('stroke:'));
if (edge.look === 'handDrawn') {
const rc = rough.svg(elem);

View File

@@ -233,6 +233,10 @@ export async function erBox<T extends SVGGraphicsElement>(parent: D3Selection<T>
yOffsets.push(0);
// Draw row rects
for (const [i, yOffset] of yOffsets.entries()) {
if (i === 0 && yOffsets.length > 1) {
continue;
// Skip first row
}
const isEven = i % 2 === 0 && yOffset !== 0;
const roughRect = rc.rectangle(x, nameBBox.height + y + yOffset, w, nameBBox.height, {
...options,