Miss formed arrows in class diagram

0 votes
asked Dec 6, 2016 in bug by jgueunie (120 points)

When class are place into a package, the end of arrows is place at the midlle of the segment .

Test made with plantumlt 8051

Test code below ( comment out package line to get a correct drawing)

 

@startuml "Class_png"
title  class diagram
 
VCAN_DRV *-- PCAN_DRV : 1 .. 1
 
class VCAN_DRV {
 
}
 
 
package PCAN_DRV {
PCAN_DRV "1" *-left- "1" Bus_Control : contains
PCAN_DRV *-- Bus_Tx : 1..1
PCAN_DRV *-- Bus_Rx : 1..1
 
class PCAN_DRV {
}
 
class Bus_Control {
}
 
package Bus_Tx {
Bus_Tx "1" *--  "n" Tx_FIFO 
class Bus_Tx {
}
 
class Tx_FIFO {
 
}
}
 
package Bus_Rx {
Bus_Rx "1" *-- "n" Rx_FIFO
class Bus_Rx {
}
 
class Rx_FIFO {
}
 
}
}
@enduml

1 Answer

0 votes
answered Dec 6, 2016 by plantuml (134,570 points)

Hi,

Thanks for the report.

We are going to fix this.

The parser is confused because there are classes and packages with the same name (for example PCAN_DRV). You can turn around the bug by declaring the class before declaring links using this class :

@startuml
title  class diagram
 
VCAN_DRV *-- PCAN_DRV : 1 .. 1
 
class VCAN_DRV {
 
}
 
 
package PCAN_DRV {
class PCAN_DRV {
}

PCAN_DRV "1" *-left- "1" Bus_Control : contains
PCAN_DRV *-- Bus_Tx : 1..1
PCAN_DRV *-- Bus_Rx : 1..1
 
 
class Bus_Control {
}
 
package Bus_Tx {
class Bus_Tx {
}

Bus_Tx "1" *--  "n" Tx_FIFO
 
class Tx_FIFO {
 
}
}
 
package Bus_Rx {
class Bus_Rx {
}

Bus_Rx "1" *-- "n" Rx_FIFO
 
class Rx_FIFO {
}
 
}
}
@enduml

Result: http://www.plantuml.com/plantuml/uml/PP4z2uCm48Rt_8eZOq4XQoTRYz2bBK5S9QWLQOp5H122_xrHOsBR8N0VxpttSecaOhqQMevKetW5K70c9PGDgtlM8a1PVBhb5vh18GZWiIL78126G8nW7N0oRKgJUO3Uh7Ynkl93scftXGcv11DiTl3ggO8bFWyoZpkX-ewRTOM9M2Earyz-Paqwpcx2aFotg6k1Cxh7wiNfvjF2z4wuf1EouUem0C02GphcoJMvU_1MM0_m2wRVOEh1r8DdBbqn3aiTThBWg1Ab-R0F

However, this is still a bug, and we are going to fix it.

Thanks again,

commented Dec 16, 2016 by anonymous
Thanks a lot :)
...