mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user