Is there a way to set top, bottom, left, and right paddings individually?

0 votes
asked Sep 3, 2019 in Wanted features by Behrang

For some reason in recent versions of PlantUML text inside a class overlaps the right border of the class:

https://imgur.com/a/5HinTeK

  1. Is there a current workaround to prevent this from happening?
  2. Is there a way to add a 10px padding to the right side of class boxes without changing their bottom, left, and top paddings?
Thanks in advance.

2 Answers

0 votes
answered Sep 12, 2019 by Hendrik (160 points)
you might add add the end of the line (without the brackets:

[      <size:0>.]

this adds a few spaces at the end of the line
0 votes
answered Sep 12, 2019 by plantuml (294,960 points)
Could you post here the source text of your diagram ?

It would help us!

Thanks,
commented Sep 2, 2020 by Pradeep Singh
Please find "line item" between Order and OrderDetails. Also check padding by changing skinparam linetype.

@startuml
skinparam linetype ortho
'skinparam linetype polyline
'skinparam linetype curved

!$spacing1_1=""
!$spacing1_2="   "
!$spacing2_1=" "
!$spacing2_2=" "
!$spacing3_1="   "
!$spacing3_2="  "
!$spacing4_1="  "
!$spacing4_2=" "

!$text_1_1="1"+$spacing1_1+"<size:0>."
!$text_1_2="1..*"+$spacing1_2+"<size:0>."
!$text_2_1="1"+$spacing2_1+"<size:0>."
!$text_2_2="0..*"+$spacing2_2+"<size:0>."
!$text_3_1="1"+$spacing3_1+"<size:0>."
!$text_3_2="1..*"+$spacing3_2+"<size:0>."
!$text_4_1="0..*"+$spacing4_1+"<size:0>."
!$text_4_2="1"+$spacing4_2+"<size:0>."

class Order {
 -date : Date
 -status: String

 +calcSubTotal()
 +calcTax()
 +calcTotal()
 +calcTotalWeight()
}

abstract class Payment {
 -amount : float
}

Order "$text_1_1"--"$text_1_2" Payment

class Cash extends Payment {
 -cashTendered : float
}

class Check extends Payment {
    -name : String
    -bankID : String

    +authorized()
}

class Credit extends Payment {
    -number : String
    -type : String
    -expDate

    +authorized()
}

class Customer {
    -name : String
    -address
}

Customer "$text_2_1"--"$text_2_2" Order

class OrderDetails {
    -quantity
    -taxStatus: String

    +calcSubTotal()
    +calcWeight()
    +calcTax()
}

Order "$text_3_1" o-- "$text_3_2" OrderDetails: line item

class Item {
    -shippingWeight
    -description: String

    +getPriceForQuantity()
    +getTax()
    +InStock()
}

OrderDetails "$text_4_1" --> "$text_4_2" Item
@enduml

Current Output:

https://drive.google.com/file/d/1n7cW-wLG87fBnOM-A7KS4xy_5uRh4Vbs/view?usp=sharing
...