Issue 299: Sequence diagram Loops: changing boxMargin spoils the "loop" notation

In Sequence diagrams, a loop section draws a box with the word "loop"
in the top left corner. This is all good. In addition, the title of the
loop is in the center of the box, near the top of the box.

To add a bit of margin between the Loop title and the line at the top
of the box, change the configuration field boxMargin

Problem: by error, the boxMargin is also used for positioning the
"loop" label. SInce the loop label is in a fixed small place, changing
boxMargin causes the word "loop" to move out of its box.
This commit is contained in:
LarryKlugerDS
2016-02-10 08:33:12 +02:00
parent b5a030c78d
commit 31f78d1aa9

View File

@@ -151,8 +151,8 @@ exports.drawLoop = function(elem,bounds,labelText, conf){
txt.text = labelText;
txt.x = bounds.startx;
txt.y = bounds.starty;
txt.labelMargin = 1.5 * conf.boxMargin;
txt.class = 'labelText';
txt.labelMargin = 1.5 * 10; // This is the small box that says "loop"
txt.class = 'labelText'; // Its size & position are fixed.
txt.fill = 'white';
exports.drawLabel(g,txt);