fix: cr, more testcase

This commit is contained in:
donglixiaoche 2023-03-22 13:45:24 +08:00
parent 22cce86892
commit b9a94ca11f
No known key found for this signature in database
GPG key ID: 3190E65EBAD6D6E2
5 changed files with 475 additions and 222 deletions

View file

@ -30,6 +30,13 @@ func testStable(t *testing.T) {
a -> b a -> b
c -> d c -> d
} }
a: {
near: top-center
b: {
c
}
}
`, `,
}, },
{ {

View file

@ -208,12 +208,135 @@
"zIndex": 0, "zIndex": 0,
"level": 2 "level": 2
}, },
{
"id": "a",
"type": "rectangle",
"pos": {
"x": -86,
"y": -245
},
"width": 173,
"height": 225,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "B4",
"stroke": "B1",
"shadow": false,
"3d": false,
"multiple": false,
"double-border": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "a",
"fontSize": 28,
"fontFamily": "DEFAULT",
"language": "",
"color": "N1",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 12,
"labelHeight": 36,
"labelPosition": "OUTSIDE_TOP_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "a.b",
"type": "rectangle",
"pos": {
"x": -66,
"y": -179
},
"width": 133,
"height": 130,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "B5",
"stroke": "B1",
"shadow": false,
"3d": false,
"multiple": false,
"double-border": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "b",
"fontSize": 24,
"fontFamily": "DEFAULT",
"language": "",
"color": "N1",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 12,
"labelHeight": 31,
"labelPosition": "OUTSIDE_TOP_CENTER",
"zIndex": 0,
"level": 2
},
{
"id": "a.b.c",
"type": "rectangle",
"pos": {
"x": -26,
"y": -147
},
"width": 53,
"height": 66,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "B6",
"stroke": "B1",
"shadow": false,
"3d": false,
"multiple": false,
"double-border": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "c",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "N1",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 8,
"labelHeight": 21,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 3
},
{ {
"id": "x", "id": "x",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": -390, "x": -390,
"y": -261 "y": -526
}, },
"width": 247, "width": 247,
"height": 291, "height": 291,
@ -254,7 +377,7 @@
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": -350, "x": -350,
"y": -232 "y": -497
}, },
"width": 53, "width": 53,
"height": 66, "height": 66,
@ -295,7 +418,7 @@
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": -350, "x": -350,
"y": -66 "y": -331
}, },
"width": 53, "width": 53,
"height": 66, "height": 66,
@ -336,7 +459,7 @@
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": -236, "x": -236,
"y": -232 "y": -497
}, },
"width": 53, "width": 53,
"height": 66, "height": 66,
@ -377,7 +500,7 @@
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": -237, "x": -237,
"y": -66 "y": -331
}, },
"width": 54, "width": 54,
"height": 66, "height": 66,
@ -418,7 +541,7 @@
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 143, "x": 143,
"y": -261 "y": -526
}, },
"width": 247, "width": 247,
"height": 291, "height": 291,
@ -459,7 +582,7 @@
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 183, "x": 183,
"y": -232 "y": -497
}, },
"width": 53, "width": 53,
"height": 66, "height": 66,
@ -500,7 +623,7 @@
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 183, "x": 183,
"y": -66 "y": -331
}, },
"width": 53, "width": 53,
"height": 66, "height": 66,
@ -541,7 +664,7 @@
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 297, "x": 297,
"y": -232 "y": -497
}, },
"width": 53, "width": 53,
"height": 66, "height": 66,
@ -582,7 +705,7 @@
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 296, "x": 296,
"y": -66 "y": -331
}, },
"width": 54, "width": 54,
"height": 66, "height": 66,
@ -746,19 +869,19 @@
"route": [ "route": [
{ {
"x": -324, "x": -324,
"y": -166 "y": -431
}, },
{ {
"x": -324, "x": -324,
"y": -126 "y": -391
}, },
{ {
"x": -324, "x": -324,
"y": -106 "y": -371
}, },
{ {
"x": -324, "x": -324,
"y": -66 "y": -331
} }
], ],
"isCurve": true, "isCurve": true,
@ -795,19 +918,19 @@
"route": [ "route": [
{ {
"x": -210.5, "x": -210.5,
"y": -166 "y": -431
}, },
{ {
"x": -210.5, "x": -210.5,
"y": -126 "y": -391
}, },
{ {
"x": -210.5, "x": -210.5,
"y": -106 "y": -371
}, },
{ {
"x": -210.5, "x": -210.5,
"y": -66 "y": -331
} }
], ],
"isCurve": true, "isCurve": true,
@ -844,19 +967,19 @@
"route": [ "route": [
{ {
"x": 210, "x": 210,
"y": -166 "y": -431
}, },
{ {
"x": 210, "x": 210,
"y": -126 "y": -391
}, },
{ {
"x": 210, "x": 210,
"y": -106 "y": -371
}, },
{ {
"x": 210, "x": 210,
"y": -66 "y": -331
} }
], ],
"isCurve": true, "isCurve": true,
@ -893,19 +1016,19 @@
"route": [ "route": [
{ {
"x": 323.5, "x": 323.5,
"y": -166 "y": -431
}, },
{ {
"x": 323.5, "x": 323.5,
"y": -126 "y": -391
}, },
{ {
"x": 323.5, "x": 323.5,
"y": -106 "y": -371
}, },
{ {
"x": 323.5, "x": 323.5,
"y": -66 "y": -331
} }
], ],
"isCurve": true, "isCurve": true,

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 658 KiB

After

Width:  |  Height:  |  Size: 659 KiB

View file

@ -208,12 +208,135 @@
"zIndex": 0, "zIndex": 0,
"level": 2 "level": 2
}, },
{
"id": "a",
"type": "rectangle",
"pos": {
"x": -126,
"y": -286
},
"width": 253,
"height": 266,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "B4",
"stroke": "B1",
"shadow": false,
"3d": false,
"multiple": false,
"double-border": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "a",
"fontSize": 28,
"fontFamily": "DEFAULT",
"language": "",
"color": "N1",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 12,
"labelHeight": 36,
"labelPosition": "INSIDE_TOP_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "a.b",
"type": "rectangle",
"pos": {
"x": -76,
"y": -236
},
"width": 153,
"height": 166,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "B5",
"stroke": "B1",
"shadow": false,
"3d": false,
"multiple": false,
"double-border": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "b",
"fontSize": 24,
"fontFamily": "DEFAULT",
"language": "",
"color": "N1",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 12,
"labelHeight": 31,
"labelPosition": "INSIDE_TOP_CENTER",
"zIndex": 0,
"level": 2
},
{
"id": "a.b.c",
"type": "rectangle",
"pos": {
"x": -26,
"y": -186
},
"width": 53,
"height": 66,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "B6",
"stroke": "B1",
"shadow": false,
"3d": false,
"multiple": false,
"double-border": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "c",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "N1",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 8,
"labelHeight": 21,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 3
},
{ {
"id": "x", "id": "x",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": -360, "x": -373,
"y": -252 "y": -558
}, },
"width": 227, "width": 227,
"height": 302, "height": 302,
@ -253,8 +376,8 @@
"id": "x.a", "id": "x.a",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": -310, "x": -323,
"y": -202 "y": -508
}, },
"width": 53, "width": 53,
"height": 66, "height": 66,
@ -294,8 +417,8 @@
"id": "x.b", "id": "x.b",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": -310, "x": -323,
"y": -66 "y": -372
}, },
"width": 53, "width": 53,
"height": 66, "height": 66,
@ -335,8 +458,8 @@
"id": "x.c", "id": "x.c",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": -237, "x": -250,
"y": -202 "y": -508
}, },
"width": 53, "width": 53,
"height": 66, "height": 66,
@ -376,8 +499,8 @@
"id": "x.d", "id": "x.d",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": -237, "x": -250,
"y": -66 "y": -372
}, },
"width": 54, "width": 54,
"height": 66, "height": 66,
@ -417,8 +540,8 @@
"id": "y", "id": "y",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 133, "x": 146,
"y": -252 "y": -558
}, },
"width": 227, "width": 227,
"height": 302, "height": 302,
@ -458,8 +581,8 @@
"id": "y.a", "id": "y.a",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 183, "x": 196,
"y": -202 "y": -508
}, },
"width": 53, "width": 53,
"height": 66, "height": 66,
@ -499,8 +622,8 @@
"id": "y.b", "id": "y.b",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 183, "x": 196,
"y": -66 "y": -372
}, },
"width": 53, "width": 53,
"height": 66, "height": 66,
@ -540,8 +663,8 @@
"id": "y.c", "id": "y.c",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 257, "x": 270,
"y": -202 "y": -508
}, },
"width": 53, "width": 53,
"height": 66, "height": 66,
@ -581,8 +704,8 @@
"id": "y.d", "id": "y.d",
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 256, "x": 269,
"y": -66 "y": -372
}, },
"width": 54, "width": 54,
"height": 66, "height": 66,
@ -727,12 +850,12 @@
"labelPercentage": 0, "labelPercentage": 0,
"route": [ "route": [
{ {
"x": -284, "x": -297,
"y": -136 "y": -442
}, },
{ {
"x": -284, "x": -297,
"y": -66 "y": -372
} }
], ],
"animated": false, "animated": false,
@ -767,12 +890,12 @@
"labelPercentage": 0, "labelPercentage": 0,
"route": [ "route": [
{ {
"x": -210.5, "x": -223.5,
"y": -136 "y": -442
}, },
{ {
"x": -210.5, "x": -223.5,
"y": -66 "y": -372
} }
], ],
"animated": false, "animated": false,
@ -807,12 +930,12 @@
"labelPercentage": 0, "labelPercentage": 0,
"route": [ "route": [
{ {
"x": 210, "x": 223,
"y": -136 "y": -442
}, },
{ {
"x": 210, "x": 223,
"y": -66 "y": -372
} }
], ],
"animated": false, "animated": false,
@ -847,12 +970,12 @@
"labelPercentage": 0, "labelPercentage": 0,
"route": [ "route": [
{ {
"x": 283.5, "x": 296.5,
"y": -136 "y": -442
}, },
{ {
"x": 283.5, "x": 296.5,
"y": -66 "y": -372
} }
], ],
"animated": false, "animated": false,

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 658 KiB

After

Width:  |  Height:  |  Size: 659 KiB