ChrisSteinbach / mscgen

Automatically exported from code.google.com/p/mscgen
GNU General Public License v2.0
0 stars 0 forks source link

Eliminate whitespace "margins" on left and right of output. #65

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
My mscgen diagrams always end up with extra
whitespace on the left/right.  When I have to
increase the hscale to make room for long labels,
the whitespace also grows and ends up pushing the
diagram off the right hand side of the page.

It would be nice if there were an option to get
rid of the extra whitespace and generate a proper
bounding box in SVG output and do the equivalent
of ImageMagick's "convert -trim" on PNG output.

I'm guessing the extra space is allocated for the
looping "send a message to myself" arrows, but it
doesn't need to be included in the output if it's
not needed.

Would a patch that adds a "-trim" option likely be
accepted?

Original issue reported on code.google.com by Grant.B....@gmail.com on 30 Jul 2011 at 7:11

GoogleCodeExporter commented 9 years ago
Yep - it's for the looping "message to self" arcs, or for boxes and shapes that 
may also use that space.

There is a first parse to work out the canvas dimensions and row heights, so 
it's possible to check if the space is needed at that time, and then omit it.  

If there was a loop on the left but not the right, would you still expect the 
right space to be trimmed, or should it be preserved from more central 
alignment?

Original comment by Michael....@gmail.com on 1 Aug 2011 at 7:37