如何让PlantUML中Client类的注释保持原位置
PlantUML注释位置固定方案
当添加带原型的箭头后Client类的注释位置偏移,可通过明确指定注释位置强制固定在左侧:
方法1:直接指定注释位置
在定义注释时使用note left of语法,强制注释位于目标类左侧:
class Client { // 类成员 } note left of Client: 你的注释内容 Client -[#blue,dashed]> ConcreteStrategy1 : 使用 <原型>
方法2:关联独立注释块
若注释是单独定义的块,可通过left of关联到Client左侧:
class Client note as Note1: 你的注释内容 Note1 left of Client Client -[#blue,dashed]> ConcreteStrategy1 : 使用 <原型>
以上两种方式都会让注释不受布局引擎调整影响,始终保持在Client类左侧。
内容的提问来源于stack exchange,提问作者Cody
相关产品推荐
相关产品推荐

