Fix actor padding for long notes

This commit is contained in:
Júlio César Batista 2022-12-05 13:43:05 -08:00
parent c5266e2b62
commit 69385e016f
No known key found for this signature in database
GPG key ID: 10C4B861BF314878
5 changed files with 77 additions and 74 deletions

View file

@ -142,6 +142,9 @@ func newSequenceDiagram(objects []*d2graph.Object, messages []*d2graph.Edge) *se
nextActorHW := actors[rank+1].Width / 2.
sd.actorXStep[rank] = math.Max(actorHW+nextActorHW+HORIZONTAL_PAD, MIN_ACTOR_DISTANCE)
sd.actorXStep[rank] = math.Max(maxNoteWidth/2.+HORIZONTAL_PAD, sd.actorXStep[rank])
if rank > 0 {
sd.actorXStep[rank-1] = math.Max(maxNoteWidth/2.+HORIZONTAL_PAD, sd.actorXStep[rank-1])
}
}
}

View file

@ -8,7 +8,7 @@
"x": -121,
"y": 266
},
"width": 592,
"width": 655,
"height": 952,
"opacity": 1,
"strokeDash": 0,
@ -47,7 +47,7 @@
"x": -97,
"y": 396
},
"width": 544,
"width": 607,
"height": 798,
"opacity": 1,
"strokeDash": 0,
@ -86,7 +86,7 @@
"x": -73,
"y": 526
},
"width": 496,
"width": 559,
"height": 644,
"opacity": 1,
"strokeDash": 0,
@ -125,7 +125,7 @@
"x": -49,
"y": 656
},
"width": 448,
"width": 511,
"height": 490,
"opacity": 1,
"strokeDash": 0,
@ -244,7 +244,7 @@
"x": 25,
"y": 1042
},
"width": 350,
"width": 413,
"height": 80,
"opacity": 1,
"strokeDash": 0,
@ -280,10 +280,10 @@
"id": "alt",
"type": "",
"pos": {
"x": 251,
"x": 314,
"y": 1148
},
"width": 461,
"width": 460,
"height": 518,
"opacity": 1,
"strokeDash": 0,
@ -319,10 +319,10 @@
"id": "alt.case 1",
"type": "",
"pos": {
"x": 275,
"x": 338,
"y": 1172
},
"width": 413,
"width": 412,
"height": 80,
"opacity": 1,
"strokeDash": 0,
@ -358,10 +358,10 @@
"id": "alt.case 2",
"type": "",
"pos": {
"x": 275,
"x": 338,
"y": 1302
},
"width": 413,
"width": 412,
"height": 80,
"opacity": 1,
"strokeDash": 0,
@ -397,10 +397,10 @@
"id": "alt.case 3",
"type": "",
"pos": {
"x": 275,
"x": 338,
"y": 1432
},
"width": 413,
"width": 412,
"height": 80,
"opacity": 1,
"strokeDash": 0,
@ -436,10 +436,10 @@
"id": "alt.case 4",
"type": "",
"pos": {
"x": 275,
"x": 338,
"y": 1562
},
"width": 413,
"width": 412,
"height": 80,
"opacity": 1,
"strokeDash": 0,
@ -475,7 +475,7 @@
"id": "b",
"type": "",
"pos": {
"x": 250,
"x": 313,
"y": 50
},
"width": 150,
@ -515,7 +515,7 @@
"id": "b.note",
"type": "rectangle",
"pos": {
"x": 62,
"x": 125,
"y": 2052
},
"width": 525,
@ -595,7 +595,7 @@
"id": "c",
"type": "",
"pos": {
"x": 543,
"x": 605,
"y": 50
},
"width": 190,
@ -663,7 +663,7 @@
"y": 306
},
{
"x": 325,
"x": 388,
"y": 306
}
],
@ -702,7 +702,7 @@
"y": 436
},
{
"x": 325,
"x": 388,
"y": 436
}
],
@ -741,7 +741,7 @@
"y": 566
},
{
"x": 325,
"x": 388,
"y": 566
}
],
@ -780,7 +780,7 @@
"y": 952
},
{
"x": 325,
"x": 388,
"y": 952
}
],
@ -819,7 +819,7 @@
"y": 1082
},
{
"x": 325,
"x": 388,
"y": 1082
}
],
@ -854,11 +854,11 @@
"labelPercentage": 0,
"route": [
{
"x": 325,
"x": 388,
"y": 1212
},
{
"x": 638,
"x": 700,
"y": 1212
}
],
@ -893,11 +893,11 @@
"labelPercentage": 0,
"route": [
{
"x": 325,
"x": 388,
"y": 1342
},
{
"x": 638,
"x": 700,
"y": 1342
}
],
@ -932,11 +932,11 @@
"labelPercentage": 0,
"route": [
{
"x": 325,
"x": 388,
"y": 1472
},
{
"x": 638,
"x": 700,
"y": 1472
}
],
@ -971,11 +971,11 @@
"labelPercentage": 0,
"route": [
{
"x": 325,
"x": 388,
"y": 1602
},
{
"x": 638,
"x": 700,
"y": 1602
}
],
@ -1049,11 +1049,11 @@
"labelPercentage": 0,
"route": [
{
"x": 325,
"x": 388,
"y": 176
},
{
"x": 325,
"x": 388,
"y": 2308
}
],
@ -1088,11 +1088,11 @@
"labelPercentage": 0,
"route": [
{
"x": 638,
"x": 700,
"y": 176
},
{
"x": 638,
"x": 700,
"y": 2308
}
],

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 332 KiB

After

Width:  |  Height:  |  Size: 332 KiB

View file

@ -8,7 +8,7 @@
"x": -121,
"y": 266
},
"width": 592,
"width": 655,
"height": 952,
"opacity": 1,
"strokeDash": 0,
@ -47,7 +47,7 @@
"x": -97,
"y": 396
},
"width": 544,
"width": 607,
"height": 798,
"opacity": 1,
"strokeDash": 0,
@ -86,7 +86,7 @@
"x": -73,
"y": 526
},
"width": 496,
"width": 559,
"height": 644,
"opacity": 1,
"strokeDash": 0,
@ -125,7 +125,7 @@
"x": -49,
"y": 656
},
"width": 448,
"width": 511,
"height": 490,
"opacity": 1,
"strokeDash": 0,
@ -244,7 +244,7 @@
"x": 25,
"y": 1042
},
"width": 350,
"width": 413,
"height": 80,
"opacity": 1,
"strokeDash": 0,
@ -280,10 +280,10 @@
"id": "alt",
"type": "",
"pos": {
"x": 251,
"x": 314,
"y": 1148
},
"width": 461,
"width": 460,
"height": 518,
"opacity": 1,
"strokeDash": 0,
@ -319,10 +319,10 @@
"id": "alt.case 1",
"type": "",
"pos": {
"x": 275,
"x": 338,
"y": 1172
},
"width": 413,
"width": 412,
"height": 80,
"opacity": 1,
"strokeDash": 0,
@ -358,10 +358,10 @@
"id": "alt.case 2",
"type": "",
"pos": {
"x": 275,
"x": 338,
"y": 1302
},
"width": 413,
"width": 412,
"height": 80,
"opacity": 1,
"strokeDash": 0,
@ -397,10 +397,10 @@
"id": "alt.case 3",
"type": "",
"pos": {
"x": 275,
"x": 338,
"y": 1432
},
"width": 413,
"width": 412,
"height": 80,
"opacity": 1,
"strokeDash": 0,
@ -436,10 +436,10 @@
"id": "alt.case 4",
"type": "",
"pos": {
"x": 275,
"x": 338,
"y": 1562
},
"width": 413,
"width": 412,
"height": 80,
"opacity": 1,
"strokeDash": 0,
@ -475,7 +475,7 @@
"id": "b",
"type": "",
"pos": {
"x": 250,
"x": 313,
"y": 50
},
"width": 150,
@ -515,7 +515,7 @@
"id": "b.note",
"type": "rectangle",
"pos": {
"x": 62,
"x": 125,
"y": 2052
},
"width": 525,
@ -595,7 +595,7 @@
"id": "c",
"type": "",
"pos": {
"x": 543,
"x": 605,
"y": 50
},
"width": 190,
@ -663,7 +663,7 @@
"y": 306
},
{
"x": 325,
"x": 388,
"y": 306
}
],
@ -702,7 +702,7 @@
"y": 436
},
{
"x": 325,
"x": 388,
"y": 436
}
],
@ -741,7 +741,7 @@
"y": 566
},
{
"x": 325,
"x": 388,
"y": 566
}
],
@ -780,7 +780,7 @@
"y": 952
},
{
"x": 325,
"x": 388,
"y": 952
}
],
@ -819,7 +819,7 @@
"y": 1082
},
{
"x": 325,
"x": 388,
"y": 1082
}
],
@ -854,11 +854,11 @@
"labelPercentage": 0,
"route": [
{
"x": 325,
"x": 388,
"y": 1212
},
{
"x": 638,
"x": 700,
"y": 1212
}
],
@ -893,11 +893,11 @@
"labelPercentage": 0,
"route": [
{
"x": 325,
"x": 388,
"y": 1342
},
{
"x": 638,
"x": 700,
"y": 1342
}
],
@ -932,11 +932,11 @@
"labelPercentage": 0,
"route": [
{
"x": 325,
"x": 388,
"y": 1472
},
{
"x": 638,
"x": 700,
"y": 1472
}
],
@ -971,11 +971,11 @@
"labelPercentage": 0,
"route": [
{
"x": 325,
"x": 388,
"y": 1602
},
{
"x": 638,
"x": 700,
"y": 1602
}
],
@ -1049,11 +1049,11 @@
"labelPercentage": 0,
"route": [
{
"x": 325,
"x": 388,
"y": 176
},
{
"x": 325,
"x": 388,
"y": 2308
}
],
@ -1088,11 +1088,11 @@
"labelPercentage": 0,
"route": [
{
"x": 638,
"x": 700,
"y": 176
},
{
"x": 638,
"x": 700,
"y": 2308
}
],

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 332 KiB

After

Width:  |  Height:  |  Size: 332 KiB