fix: fixed central connection for bidirectional dotted arrow

on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
omkarht
2025-09-11 13:03:06 +05:30
parent daeb85bac2
commit e3ef5e4208

View File

@@ -1631,8 +1631,12 @@ const hasCentralConnection = function (msg, diagObj) {
* @returns The offset to apply to startx position * @returns The offset to apply to startx position
*/ */
const calculateCentralConnectionOffset = function (msg, diagObj, isArrowToRight) { const calculateCentralConnectionOffset = function (msg, diagObj, isArrowToRight) {
const { CENTRAL_CONNECTION_REVERSE, CENTRAL_CONNECTION_DUAL, BIDIRECTIONAL_SOLID } = const {
diagObj.db.LINETYPE; CENTRAL_CONNECTION_REVERSE,
CENTRAL_CONNECTION_DUAL,
BIDIRECTIONAL_SOLID,
BIDIRECTIONAL_DOTTED,
} = diagObj.db.LINETYPE;
let offset = 0; let offset = 0;
@@ -1643,7 +1647,10 @@ const calculateCentralConnectionOffset = function (msg, diagObj, isArrowToRight)
offset += CENTRAL_CONNECTION_BASE_OFFSET; offset += CENTRAL_CONNECTION_BASE_OFFSET;
} }
if (msg.centralConnection === CENTRAL_CONNECTION_DUAL && msg.type === BIDIRECTIONAL_SOLID) { if (
msg.centralConnection === CENTRAL_CONNECTION_DUAL &&
(msg.type === BIDIRECTIONAL_SOLID || msg.type === BIDIRECTIONAL_DOTTED)
) {
offset += isArrowToRight ? 0 : -CENTRAL_CONNECTION_BIDIRECTIONAL_OFFSET; offset += isArrowToRight ? 0 : -CENTRAL_CONNECTION_BIDIRECTIONAL_OFFSET;
} }