I have discovered a weird issue, where if you put a grouping around some objects then it ignores or at least de-prioritises the placement of the objects. This is a minimal set that creates the problem. In the diagram below, input should be on the left and output on the right, but they both end up on the right, with the grouping.
@startuml
rectangle "Group Header" as GH {
rectangle "Group Rect 1" as AM
rectangle "Group Rect 2" as RECT2
}
rectangle "Input" as INPT
rectangle "Output" as OUT
rectangle "Common Output" as COUT
INPT -right-> RECT2
RECT2 -right-> OUT
RECT2 -up-> AM
RECT2 -up-> COUT
AM -up-> COUT
@enduml
Commenting out the group fixes it:
@startuml
' rectangle "Group Header" as GH {
rectangle "Group Rect 1" as AM
rectangle "Group Rect 2" as RECT2
' }
rectangle "Input" as INPT
rectangle "Output" as OUT
rectangle "Common Output" as COUT
INPT -right-> RECT2
RECT2 -right-> OUT
RECT2 -up-> AM
RECT2 -up-> COUT
AM -up-> COUT
@enduml
Is this fixable? Or is the positioning of elements simply best effort?