prevent text overlap in activity switch

0 votes
asked May 31, 2021 in Question / help by mentaal
@startuml
start
switch (errorType )
case ( some long case condition here blah blah blah)
   :GP Interrupt to other core;
case ( another case to consider here )
   :Save errorCode;
endswitch
stop
@enduml

The resultant conditions overlap if one is too long. How can I prevent this?

Even something simple like a plain circle has text cropped. Is there a general mechanism to prevent this?

Example: http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuKhEB4hEILKepizDBSd8p4ldSaZDIm5A0000
commented May 31, 2021 by The-Lu (63,920 points)

Hello all,

For:

Even something simple like a plain circle has text cropped. Is there a general mechanism to prevent this?

Example: http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuKhEB4hEILKepizDBSd8p4ldSaZDIm5A0000

See similar defect here:

Regards,
Th.

1 Answer

0 votes
answered May 31, 2021 by Martin (8,360 points)
edited May 31, 2021 by Martin

I hesitated making this an answer rather a comment, as it is more of a workaround and there's room for improvement in Plantuml.  Ideally diagrams shouldn't need manual tweaking, although it would be a rather wide diagram if the text length was honoured.  There may be a MaximumWidth style to force word-wrap, but I couldn't find it.

But for the first one, you can use newlines to separate the two lines of text:

Also, it may help to know that the space available to the label text is dependent on the size of the action box below:

For the circle one, you can use a root level margin.  But I don't know why the circle is off-centre.

commented May 31, 2021 by mentaal
Even as a workaround, I'll take it. The alternative of manually making these sorts of diagrams is far worse. Thanks very much for the prompt help Martin!
...