only add extra x padding for non-special shapes

This commit is contained in:
Gavin Nishizawa 2023-01-23 20:33:41 -08:00
parent d5f2ed00d5
commit 162227e196
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

@ -1162,11 +1162,15 @@ func (g *Graph) SetDimensions(mtexts []*d2target.MText, ruler *textmeasure.Ruler
paddingX += 20
paddingY += 20
}
if obj.Attributes.Link != "" {
paddingX += 32
}
if obj.Attributes.Tooltip != "" {
paddingX += 32
switch shapeType {
case shape.TABLE_TYPE, shape.CLASS_TYPE, shape.CODE_TYPE, shape.IMAGE_TYPE:
default:
if obj.Attributes.Link != "" {
paddingX += 32
}
if obj.Attributes.Tooltip != "" {
paddingX += 32
}
}
if desiredWidth == 0 && desiredHeight == 0 {