mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-04 22:59:50 +02:00
Fix for multi-line row issue and failsafe for edge style for stroke not present
This commit is contained in:
@@ -521,7 +521,7 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
|
|||||||
let svgPath;
|
let svgPath;
|
||||||
let linePath = lineFunction(lineData);
|
let linePath = lineFunction(lineData);
|
||||||
const edgeStyles = Array.isArray(edge.style) ? edge.style : [edge.style];
|
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') {
|
if (edge.look === 'handDrawn') {
|
||||||
const rc = rough.svg(elem);
|
const rc = rough.svg(elem);
|
||||||
|
@@ -233,6 +233,10 @@ export async function erBox<T extends SVGGraphicsElement>(parent: D3Selection<T>
|
|||||||
yOffsets.push(0);
|
yOffsets.push(0);
|
||||||
// Draw row rects
|
// Draw row rects
|
||||||
for (const [i, yOffset] of yOffsets.entries()) {
|
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 isEven = i % 2 === 0 && yOffset !== 0;
|
||||||
const roughRect = rc.rectangle(x, nameBBox.height + y + yOffset, w, nameBBox.height, {
|
const roughRect = rc.rectangle(x, nameBBox.height + y + yOffset, w, nameBBox.height, {
|
||||||
...options,
|
...options,
|
||||||
|
Reference in New Issue
Block a user