mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 23:09:49 +02:00
added ability to style nested activations
This commit is contained in:
@@ -338,7 +338,7 @@ export const draw = function (text, id) {
|
|||||||
activationData.starty = verticalPos - 6
|
activationData.starty = verticalPos - 6
|
||||||
verticalPos += 12
|
verticalPos += 12
|
||||||
}
|
}
|
||||||
svgDraw.drawActivation(diagram, activationData, verticalPos, conf)
|
svgDraw.drawActivation(diagram, activationData, verticalPos, conf, actorActivations(msg.from.actor).length)
|
||||||
|
|
||||||
bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos)
|
bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos)
|
||||||
}
|
}
|
||||||
|
@@ -101,12 +101,12 @@ export const anchorElement = function (elem) {
|
|||||||
* @param bounds - activation box bounds
|
* @param bounds - activation box bounds
|
||||||
* @param verticalPos - precise y cooridnate of bottom activation box edge
|
* @param verticalPos - precise y cooridnate of bottom activation box edge
|
||||||
*/
|
*/
|
||||||
export const drawActivation = function (elem, bounds, verticalPos) {
|
export const drawActivation = function (elem, bounds, verticalPos, conf, actorActivations) {
|
||||||
const rect = getNoteRect()
|
const rect = getNoteRect()
|
||||||
const g = bounds.anchored
|
const g = bounds.anchored
|
||||||
rect.x = bounds.startx
|
rect.x = bounds.startx
|
||||||
rect.y = bounds.starty
|
rect.y = bounds.starty
|
||||||
rect.class = 'activation'
|
rect.class = 'activation' + actorActivations
|
||||||
rect.width = bounds.stopx - bounds.startx
|
rect.width = bounds.stopx - bounds.startx
|
||||||
rect.height = verticalPos - bounds.starty
|
rect.height = verticalPos - bounds.starty
|
||||||
drawRect(g, rect)
|
drawRect(g, rect)
|
||||||
|
@@ -74,7 +74,17 @@ text.actor {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.activation {
|
.activation0 {
|
||||||
|
fill: $activationBkgColor;
|
||||||
|
stroke: $activationBorderColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activation1 {
|
||||||
|
fill: $activationBkgColor;
|
||||||
|
stroke: $activationBorderColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activation2 {
|
||||||
fill: $activationBkgColor;
|
fill: $activationBkgColor;
|
||||||
stroke: $activationBorderColor;
|
stroke: $activationBorderColor;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user