Center disalignment when using "HorizontalAlignment center"

+1 vote
asked Mar 29, 2022 in Bug by eduardomozart (360 points)

Hello, I'm using the following code to generate a WBS diagram:


node {
    HorizontalAlignment center
    LineColor blue
    BackgroundColor white
    MinimumWidth 115

arrow {
    LineColor grey

* Técnicas de Escaneamento\nCibernético
** Open Scan
** Half Open Scan
*** Version\nDetection Scan
** Stealth Scans
*** SYN|ACK Scan
*** IDLE Scan
*** FIN, XMAS, NULL\nScans
*** ACK Scan
*** Window Scan
*** TCP\nFragmentation\nScan
** Sweep Scans
*** ICMP Echo\nScan
*** ICMP\nTimestamp &\nAddress Mask\nScan
*** TCP SYN Scan
** Miscellaneous Scans
*** FTP Bounce\nScan
*** UDP Scan
*** IP Protocol\nScan
*** RPC Scan

When using "HorizontalAlignment center", some items do not seems to be centered right. The "Miscellaneous Scans" appears to be right aligned and some items like "Window Scan", "RPC Scan" and others do not seems to be centered at all.

commented Mar 29, 2022 by The-Lu (65,440 points)
edited Apr 7, 2022 by The-Lu

Hello PlantUML team and all,

It seems a artefact regression form correction of:

Then compare, this:


Thanks for your correction.

1 Answer

0 votes
answered Apr 7, 2022 by danespin (200 points)
No, it's not related to the mentioned artefact.

The center bug in HorizontalAlignment is real, it puts the strings to the right instead.

You can test it with the example of section 17.10 of the latest PDF guide.

Here it is:

commented Apr 7, 2022 by The-Lu (65,440 points)

Hello D.,

In fact `artefact ` is not a good word...
I was thinking more of `regression form correction of`, I just correcting the sentence...

And here is the image of your example:

If that can help PlantUML team for correction...

commented May 25, 2022 by anonymous

Reverting to release v1.2022.1 resolves the issue so the bug was likely inadvertently introduced whilst trying to fix issue #15441.

Hope that's helpful.
commented Nov 16, 2022 by anonymous

Hi @eduardomozart

This issue looks to fixed by "Center-aligned text not in the middle of a node" (you also need to increase your MinimumWidth value to "200" to fit the root node's content).

Here's a link to a tweaked version of your diagram.