update arrow startx position

This commit is contained in:
Ronid1
2024-06-04 15:10:50 -07:00
parent 20f9abcc38
commit d2d7f2bcb0

View File

@@ -1435,7 +1435,7 @@ const buildMessageModel = function (msg, actors, diagObj) {
const [fromLeft, fromRight] = activationBounds(msg.from, actors); const [fromLeft, fromRight] = activationBounds(msg.from, actors);
const [toLeft, toRight] = activationBounds(msg.to, actors); const [toLeft, toRight] = activationBounds(msg.to, actors);
const isArrowToRight = fromLeft <= toLeft; const isArrowToRight = fromLeft <= toLeft;
const startx = isArrowToRight ? fromRight : fromLeft; let startx = isArrowToRight ? fromRight : fromLeft;
let stopx = isArrowToRight ? toLeft : toRight; let stopx = isArrowToRight ? toLeft : toRight;
// As the line width is considered, the left and right values will be off by 2. // As the line width is considered, the left and right values will be off by 2.
@@ -1475,8 +1475,11 @@ const buildMessageModel = function (msg, actors, diagObj) {
stopx += adjustValue(3); stopx += adjustValue(3);
} }
/**
* Shorten start position of bidirectional arrow to accommodate for second arrowhead
*/
if ( if (
![diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID, diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes( [diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID, diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
msg.type msg.type
) )
) { ) {