plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
9.66k stars 878 forks source link

Hiding one of multiple stereotypes in containers (e.g. rectangles) hides all stereotypes #1735

Closed travkin79 closed 3 weeks ago

travkin79 commented 3 weeks ago

Issue The hide <<some>> stereotype instruction, in some cases, hides more stereotypes than specified. Consider the following example. Here, we have multiple stereotypes declared for a rectangle and want to hide one of them. instead, all stereotypes are hidden.

If multiple stereotypes are used without hiding one of them, there seems to be no problem (see the package in the following example).

Steps to reproduce

  1. Create a diagram with the following source code
    
    @startuml
    <style>
    root {
    .highlight {
        BackGroundColor LightGray
    }
    }
    </style>

hide <> stereotype

rectangle "System in focus" <> <> { class Class class ImportantClass <> class ClassThreadSafe <> <> class ImportantClassThreadSafe <> <> }

package other <> <> { class ExternalClassThreadSafe <> <> class ExternalImportantClass <> <> } @enduml


2. Render the diagram with PlantUML, e.g. [using the online server](https://www.plantuml.com/plantuml/uml/ZOzHIWD138RVSuhGT_K2or8iMWHzgXSOTjBkOdOYcGouoDxTx7GfMAWOc8S_-Vylassse5P6XYRRnDI2YXX-0thTzyEfPtzhezPZw3xsAYN5dR0elYxplOQfEcQOeNbOKT0FaR1fBfYsnMoa93Pz4e1IPo6Tc71pc7mmuf3mA5t96q-zIInEQQy0vvzq77B6b-Iq57Ytg5lzvmNu6tBB-juhXNW8HtA_LN6NNVqdKTTSnrpNUnmm0vppJrz_RxmaQJLwU4ifbf5_0000)

**Expected behavior**
The _highlight_ stereotype should be hidden in the rectangle "System in focus" while the _Module_ stereotype should remain visible.

![image](https://github.com/plantuml/plantuml/assets/10887297/8c03ffb4-1247-4716-afe7-55799960e8f9)

**Actual behavior**
Both stereotypes in the rectangle "System in focus" are hidden.

![image](https://github.com/plantuml/plantuml/assets/10887297/7ec0e1a7-cacc-4abe-93ef-b1905db6d03b)

**Additional context**
This issue is related to #1580.
arnaudroques commented 3 weeks ago

Many thanks for your fix!