added ability to style nested activations

This commit is contained in:
Bland, Paul
2018-08-24 11:56:28 -04:00
parent 228b832bed
commit 80c7c9a86e
3 changed files with 14 additions and 4 deletions

View File

@@ -338,7 +338,7 @@ export const draw = function (text, id) {
activationData.starty = verticalPos - 6
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)
}

View File

@@ -101,12 +101,12 @@ export const anchorElement = function (elem) {
* @param bounds - activation box bounds
* @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 g = bounds.anchored
rect.x = bounds.startx
rect.y = bounds.starty
rect.class = 'activation'
rect.class = 'activation' + actorActivations
rect.width = bounds.stopx - bounds.startx
rect.height = verticalPos - bounds.starty
drawRect(g, rect)

View File

@@ -74,7 +74,17 @@ text.actor {
font-size: 14px;
}
.activation {
.activation0 {
fill: $activationBkgColor;
stroke: $activationBorderColor;
}
.activation1 {
fill: $activationBkgColor;
stroke: $activationBorderColor;
}
.activation2 {
fill: $activationBkgColor;
stroke: $activationBorderColor;
}