How to remove diamond at the end of if/elseif

0 votes
asked Oct 21, 2024 in Question / help by matteo.concas (120 points)
edited Oct 22, 2024 by matteo.concas

I have an if/elseif/else condition inside a while loop, there's a diamond at the end of the condition which doesn't look very nice.

I have tried removing it by using 

skinparam ConditionEndStyle hline

But it didn't work. Anyone knows what I could change to not have it appear?

Here's a minimal working example:

@startuml
skinparam ConditionEndStyle hline
!pragma useVerticalIf on
start
while (While loop)
  if (Condition 1) then (true)
    :Do something;
  elseif (Condition 2) then (true)
    :Do something else;
  else
    break
  endif
endwhile
end
@enduml

commented Oct 23, 2024 by The-Lu (85,440 points)

Hi PlantUML team,

Same question with this another example:

@startuml
'skinparam ConditionEndStyle hline
!pragma useVerticalIf on
start

if (Cond 0) then
  if (Condition 1) then (true)
    :Do something;
    kill
  elseif (Condition 2) then (true)
    :Do something else;
    kill
  endif
endif
:next step;
@enduml

Thanks for the enhancement...

Regards,
Th.

1 Answer

0 votes
answered Mar 7 by dickmaley (4,160 points)
edited Mar 7 by dickmaley

I am not happy with the visual layout but the terminating diamond is gone.

image

@startuml
<style>
.card {
BackgroundColor: transparent;
FontColor: transparent;
FontSize: 1;
FontStyle:plain;
LineColor: transparent;
LineThickness: 1;
RoundCorner: 30;
bordercolor:transparent;
}
</style>
start
while (While loop)
  if (Condition 1) then (true)
    card <<card>> {
      :;
    }
    :Do something;
  elseif (Condition 2) then (true)
    :Do something else;
  else
    break
  endif
endwhile
end
@enduml

...