mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-12-03 11:04:06 +01:00
Fix for turned arrow heads and missing edge sections
This commit is contained in:
@@ -429,22 +429,19 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
|
|||||||
const tail = startNode;
|
const tail = startNode;
|
||||||
var head = endNode;
|
var head = endNode;
|
||||||
|
|
||||||
if (head.intersect && tail.intersect && points.length > 2) {
|
if (head.intersect && tail.intersect) {
|
||||||
const initialStartPoint = Object.assign({}, points[0]);
|
points = points.slice(1, edge.points.length - 1);
|
||||||
const newEnd = head.intersect(points[points.length - 2]);
|
points.unshift(tail.intersect(points[0]));
|
||||||
|
log.debug(
|
||||||
const newStart = tail.intersect(points[1]);
|
'Last point APA12',
|
||||||
if (newStart.x && newStart.y) {
|
edge.start,
|
||||||
points.unshift(newStart);
|
'-->',
|
||||||
} else {
|
edge.end,
|
||||||
points.unshift(initialStartPoint);
|
points[points.length - 1],
|
||||||
}
|
head,
|
||||||
if (newEnd.x && newEnd.y) {
|
head.intersect(points[points.length - 1])
|
||||||
const lastPoint = points[points.length - 1];
|
);
|
||||||
if (lastPoint.x !== newEnd.x && lastPoint.y !== newEnd.y) {
|
points.push(head.intersect(points[points.length - 1]));
|
||||||
points.push(newEnd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (edge.toCluster) {
|
if (edge.toCluster) {
|
||||||
log.info('to cluster abc88', clusterDb.get(edge.toCluster));
|
log.info('to cluster abc88', clusterDb.get(edge.toCluster));
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ export const cylinder = async (parent: SVGAElement, node: Node) => {
|
|||||||
Math.abs(pos.y - (node.y ?? 0)) > (node.height ?? 0) / 2 - ry))
|
Math.abs(pos.y - (node.y ?? 0)) > (node.height ?? 0) / 2 - ry))
|
||||||
) {
|
) {
|
||||||
let y = ry * ry * (1 - (x * x) / (rx * rx));
|
let y = ry * ry * (1 - (x * x) / (rx * rx));
|
||||||
if (y != 0) {
|
if (y > 0) {
|
||||||
y = Math.sqrt(y);
|
y = Math.sqrt(y);
|
||||||
}
|
}
|
||||||
y = ry - y;
|
y = ry - y;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export const styles2String = (node: Node) => {
|
|||||||
labelStyles.push(style.join(':') + ' !important');
|
labelStyles.push(style.join(':') + ' !important');
|
||||||
} else {
|
} else {
|
||||||
nodeStyles.push(style.join(':') + ' !important');
|
nodeStyles.push(style.join(':') + ' !important');
|
||||||
if (key === 'stroke' || key === 'stroke-width') {
|
if (key.includes('stroke')) {
|
||||||
borderStyles.push(style.join(':') + ' !important');
|
borderStyles.push(style.join(':') + ' !important');
|
||||||
}
|
}
|
||||||
if (key === 'fill') {
|
if (key === 'fill') {
|
||||||
|
|||||||
Reference in New Issue
Block a user