Closed GoogleCodeExporter closed 8 years ago
Issue 39 has been merged into this issue.
Original comment by NThykier@gmail.com
on 18 Apr 2010 at 7:50
Hi
I had a look at the code (r108) and noticed a couple of statements like this:
const unsigned int arcLabelLines = arcLabel ? countLines(arcLabel) : 1;
followed a bit later by:
if(arcLabelLines > 2)
{
ymax += ((arcLabelLines - 2) * drw.textHeight(&drw));
}
When I read the countLines code, I noticed that it the number of "\n" in the
string
and not the "lines" in it. Which means that a label like "a\nb" will have the
same
ymax as the label "a".
This may be the intended behaviour, but it looks a bit odd.
The documentation for countLines is also a bit "self-conflicting":
/** Count the number of lines in some string.
* This counts line breaks that are written as a litteral '\n' in the line.
* ...
* \retuns The count of lines that should be output for the given string.
*/
The first line and the \returns claims it returns the number of lines, whereas
the
second line suggest it just counts "\n". If the latter is true and the intended
behaviour, some of the code using countLines should be updated to add 1 to the
result.
Also \returns and literal appears to be misspelled.
~Niels
Original comment by NThykier@gmail.com
on 18 Apr 2010 at 8:16
Hi
I have played a bit with it and I have been able to create a patch that fixes
the
"out of bounds" for box labels with 2 lines. I have attached it, my test case
and the
results with the current mscgen (from trunk) and the ones with my patch (called
+1).
mscgen handles 1 lined labels just fine in either case; but multi-line labels
loses
their padding. This problem becomes much more apparent with my patch (since I
could
not figure out how to use the extra space for padding).
Alternatively, you could alter the code slightly so that 1 lined labels are
given a
few extra pixels and then I think it would render the bottom line okay. That
being
said, I personally think it would look better if multi-lined labels were padded
the
same way as single line labels.
Finally, I tried to make "countLines" return the number of lines (and not the
number
of "\\n" in the label); unfortunately it makes mscgen repeat the last line and I
cannot figure out why (but I did not look too hard either).
~Niels
Original comment by NThykier@gmail.com
on 28 Apr 2010 at 7:22
Attachments:
Original comment by Michael....@gmail.com
on 4 May 2010 at 11:53
This issue was closed by revision r111.
Original comment by Michael....@gmail.com
on 16 Aug 2010 at 8:59
Original issue reported on code.google.com by
magei...@googlemail.com
on 2 Nov 2009 at 8:55Attachments: