Hello, sorry if this has been asked before (I didn't find it when I searched).
I think I have found a bug in the rendering of component diagrams.
This diagram behaves as expected.
@startuml
' Behaves as expected
rectangle food {
rectangle vegetable {
}
}
rectangle food {
rectangle fruit {
}
}
rectangle "not a food" {
}
@enduml
While this diagram has some very confusing behavior.
@startuml
rectangle food {
rectangle vegetable {
}
}
rectangle food {
rectangle fruit {
}
}
rectangle fruit {
}
' The "not a food" rectangle is included in the food rectangle?
rectangle "not a food"
@enduml
Specifically, the "not a food" rectangle is included in the food rectangle where the diagram definition does not seem to include it.
I assume this is not the intended behavior for plantuml.
Am I simply abusing plantuml by declaring food twice?
I have found it very useful to be able to inject elements into the layout hierarchy independent of the location of their initial declaration (it is a handy trick when using the preprocessor to build complex diagrams).
This behavior is obviously reproducible with the plantuml webserver but I also verified it using the following plantuml version (packaged with ArchLinux).
PlantUML version 1.2020.15 (Sun Jun 28 05:39:45 MDT 2020)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US
PLANTUML_LIMIT_SIZE: 4096
Dot version: dot - graphviz version 2.44.1 (0)
Installation seems OK. File generation OK
Thanks in advance for any help :)