Skip to content

Commit 0a6a4f3

Browse files
committed
lstopo/draw: enlarge the window if a user-appended legend is too long
Signed-off-by: Brice Goglin <[email protected]>
1 parent 38e3933 commit 0a6a4f3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

utils/lstopo/lstopo-draw.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,12 @@ output_draw(struct lstopo_output *loutput)
14681468
if (textwidth > maxtextwidth)
14691469
maxtextwidth = textwidth;
14701470
ntext++;
1471+
1472+
for(i=0; i<loutput->legend_append_nr; i++) {
1473+
textwidth = get_textwidth(loutput, loutput->legend_append[i], (unsigned) strlen(loutput->legend_append[i]), fontsize);
1474+
if (textwidth > maxtextwidth)
1475+
maxtextwidth = textwidth;
1476+
}
14711477
}
14721478

14731479
if (loutput->drawing == LSTOPO_DRAWING_PREPARE) {

utils/lstopo/lstopo-no-graphics.1in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@ Remove the text legend at the bottom of the graphical output.
366366
.TP
367367
\fB\-\-append\-legend\fB <line>
368368
Append the line of text to the bottom of the legend in the graphical output.
369-
If the line is too long, it will be truncated in the output.
370369
If adding multiple lines, each line should be given separately by
371370
passing this option multiple times.
372371
.TP

0 commit comments

Comments
 (0)