@@ -76,11 +76,11 @@ export default {
76
76
case " default" :
77
77
clazz = " connect-line" ;
78
78
break ;
79
- case " loopIn " :
80
- clazz = " loop-in " ;
79
+ case " loopStart " :
80
+ clazz = " connect-line " ;
81
81
break ;
82
- case " loopOut " :
83
- clazz = " loop-out " ;
82
+ case " loopEnd " :
83
+ clazz = " connect-line " ;
84
84
break ;
85
85
default :
86
86
clazz = " connect-line" ;
@@ -305,18 +305,26 @@ export default {
305
305
y: 0 ,
306
306
};
307
307
secondArcEnd .x = startPoint .x + LINE_H ;
308
- secondArcEnd .y = stateTop - LINE_V + lineCfg .threadTitleHeight ;
308
+ secondArcEnd .y =
309
+ stateTop -
310
+ LINE_V +
311
+ lineCfg .threadTitleHeight +
312
+ lineCfg .threadToolBoxHeight ;
309
313
tempLinePath += this .drawArc (LINE_RADIUS , 0 , 0 , secondArcEnd);
310
314
return tempLinePath;
311
315
},
312
- // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight以获取连线的准确坐标
316
+ // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight与threadToolBoxHeight以获取连线的准确坐标
313
317
drawLine5OutputVUp (startPoint , endPoint , startStateTop , endStateTop ) {
314
318
let tempLinePath = " " ;
315
319
let secondArcStart;
316
320
if (startStateTop < endStateTop) {
317
321
// 比较起始状态和结束状态的上边缘的高低,根据上边缘高的状态决定垂直绘制连线的坐标
318
322
secondArcStart =
319
- startStateTop - LINE_V + LINE_RADIUS + lineCfg .threadTitleHeight ;
323
+ startStateTop -
324
+ LINE_V +
325
+ LINE_RADIUS +
326
+ lineCfg .threadTitleHeight +
327
+ lineCfg .threadToolBoxHeight ;
320
328
tempLinePath += this .drawVerticalLine (secondArcStart);
321
329
tempLinePath += this .drawLine5SecondArcUp (
322
330
startPoint,
@@ -325,7 +333,11 @@ export default {
325
333
);
326
334
} else {
327
335
secondArcStart =
328
- endStateTop - LINE_V + LINE_RADIUS + lineCfg .threadTitleHeight ;
336
+ endStateTop -
337
+ LINE_V +
338
+ LINE_RADIUS +
339
+ lineCfg .threadTitleHeight +
340
+ lineCfg .threadToolBoxHeight ;
329
341
tempLinePath += this .drawVerticalLine (secondArcStart);
330
342
tempLinePath += this .drawLine5SecondArcUp (
331
343
startPoint,
@@ -342,11 +354,15 @@ export default {
342
354
y: 0 ,
343
355
};
344
356
secondArcEnd .x = startPoint .x + LINE_H ;
345
- secondArcEnd .y = stateBottom + LINE_V + lineCfg .threadTitleHeight ;
357
+ secondArcEnd .y =
358
+ stateBottom +
359
+ LINE_V +
360
+ lineCfg .threadTitleHeight +
361
+ lineCfg .threadToolBoxHeight ;
346
362
tempLinePath += this .drawArc (LINE_RADIUS , 0 , 1 , secondArcEnd);
347
363
return tempLinePath;
348
364
},
349
- // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight以获取连线的准确坐标
365
+ // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight与threadToolBoxHeight以获取连线的准确坐标
350
366
drawLine5OutputVDown (
351
367
startPoint,
352
368
endPoint,
@@ -362,7 +378,11 @@ export default {
362
378
if (startStateBottom < endStateBottom) {
363
379
// 比较起始状态和结束状态的下边缘的高低,根据下边缘低的状态决定垂直绘制连线的坐标
364
380
secondArcStart =
365
- endStateBottom + LINE_V - LINE_RADIUS + lineCfg .threadTitleHeight ;
381
+ endStateBottom +
382
+ LINE_V -
383
+ LINE_RADIUS +
384
+ lineCfg .threadTitleHeight +
385
+ lineCfg .threadToolBoxHeight ;
366
386
tempLinePath += this .drawVerticalLine (secondArcStart);
367
387
tempLinePath += this .drawLine5SecondArcDown (
368
388
startPoint,
@@ -371,7 +391,11 @@ export default {
371
391
);
372
392
} else {
373
393
secondArcStart =
374
- startStateBottom + LINE_V - LINE_RADIUS + lineCfg .threadTitleHeight ;
394
+ startStateBottom +
395
+ LINE_V -
396
+ LINE_RADIUS +
397
+ lineCfg .threadTitleHeight +
398
+ lineCfg .threadToolBoxHeight ;
375
399
tempLinePath += this .drawVerticalLine (secondArcStart);
376
400
tempLinePath += this .drawLine5SecondArcDown (
377
401
startPoint,
@@ -390,7 +414,7 @@ export default {
390
414
endStateBottom;
391
415
startStateHeight = QBlock .State .getStateHeight (startState);
392
416
endStateHeight = QBlock .State .getStateHeight (endState);
393
- // 因嵌套内部状态的xy是相对于父状态的,需手动计算状态的上边缘与下边缘的y坐标
417
+
394
418
startStateTop = QBlock .State .getXY2Canvas (startState, this .threadIndex ).y ;
395
419
endStateTop = QBlock .State .getXY2Canvas (endState, this .threadIndex ).y ;
396
420
startStateBottom =
@@ -452,11 +476,15 @@ export default {
452
476
};
453
477
thirdArcEnd .x = endPoint .x - LINE_H ;
454
478
thirdArcEnd .y =
455
- stateTop - LINE_V + LINE_RADIUS + lineCfg .threadTitleHeight ;
479
+ stateTop -
480
+ LINE_V +
481
+ LINE_RADIUS +
482
+ lineCfg .threadTitleHeight +
483
+ lineCfg .threadToolBoxHeight ;
456
484
tempLinePath += this .drawArc (LINE_RADIUS , 1 , 0 , thirdArcEnd);
457
485
return tempLinePath;
458
486
},
459
- // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight以获取连线的准确坐标
487
+ // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight与threadToolBoxHeight以获取连线的准确坐标
460
488
drawLine5HUp (startPoint , endPoint , startStateTop , endStateTop ) {
461
489
let tempLinePath = " " ;
462
490
let thirdArcStart = {
@@ -466,7 +494,11 @@ export default {
466
494
// 比较起始状态和结束状态的上边缘的高低,根据上边缘高的状态决定水平绘制连线的坐标
467
495
if (startStateTop < endStateTop) {
468
496
thirdArcStart .x = endPoint .x - LINE_H + LINE_RADIUS ;
469
- thirdArcStart .y = startStateTop - LINE_V + lineCfg .threadTitleHeight ;
497
+ thirdArcStart .y =
498
+ startStateTop -
499
+ LINE_V +
500
+ lineCfg .threadTitleHeight +
501
+ lineCfg .threadToolBoxHeight ;
470
502
tempLinePath += this .drawLineToEndPoint (thirdArcStart);
471
503
tempLinePath += this .drawLine5ThirdArcUp (
472
504
startPoint,
@@ -475,7 +507,11 @@ export default {
475
507
);
476
508
} else {
477
509
thirdArcStart .x = endPoint .x - LINE_H + LINE_RADIUS ;
478
- thirdArcStart .y = endStateTop - LINE_V + lineCfg .threadTitleHeight ;
510
+ thirdArcStart .y =
511
+ endStateTop -
512
+ LINE_V +
513
+ lineCfg .threadTitleHeight +
514
+ lineCfg .threadToolBoxHeight ;
479
515
tempLinePath += this .drawLineToEndPoint (thirdArcStart);
480
516
tempLinePath += this .drawLine5ThirdArcUp (
481
517
startPoint,
@@ -493,11 +529,15 @@ export default {
493
529
};
494
530
thirdArcEnd .x = endPoint .x - LINE_H ;
495
531
thirdArcEnd .y =
496
- stateBottom + LINE_V - LINE_RADIUS + lineCfg .threadTitleHeight ;
532
+ stateBottom +
533
+ LINE_V -
534
+ LINE_RADIUS +
535
+ lineCfg .threadTitleHeight +
536
+ lineCfg .threadToolBoxHeight ;
497
537
tempLinePath += this .drawArc (LINE_RADIUS , 0 , 1 , thirdArcEnd);
498
538
return tempLinePath;
499
539
},
500
- // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight以获取连线的准确坐标
540
+ // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight与threadToolBoxHeight以获取连线的准确坐标
501
541
drawLine5HDown (startPoint , endPoint , startStateBottom , endStateBottom ) {
502
542
let tempLinePath = " " ;
503
543
let thirdArcStart = {
@@ -507,7 +547,11 @@ export default {
507
547
// 比较起始状态和结束状态的下边缘的高低,根据下边缘低的状态决定水平绘制连线的坐标
508
548
if (startStateBottom < endStateBottom) {
509
549
thirdArcStart .x = endPoint .x - LINE_H + LINE_RADIUS ;
510
- thirdArcStart .y = endStateBottom + LINE_V + lineCfg .threadTitleHeight ;
550
+ thirdArcStart .y =
551
+ endStateBottom +
552
+ LINE_V +
553
+ lineCfg .threadTitleHeight +
554
+ lineCfg .threadToolBoxHeight ;
511
555
tempLinePath += this .drawLineToEndPoint (thirdArcStart);
512
556
tempLinePath += this .drawLine5ThirdArcDown (
513
557
startPoint,
@@ -516,7 +560,11 @@ export default {
516
560
);
517
561
} else {
518
562
thirdArcStart .x = endPoint .x - LINE_H + LINE_RADIUS ;
519
- thirdArcStart .y = startStateBottom + LINE_V + lineCfg .threadTitleHeight ;
563
+ thirdArcStart .y =
564
+ startStateBottom +
565
+ LINE_V +
566
+ lineCfg .threadTitleHeight +
567
+ lineCfg .threadToolBoxHeight ;
520
568
tempLinePath += this .drawLineToEndPoint (thirdArcStart);
521
569
tempLinePath += this .drawLine5ThirdArcDown (
522
570
startPoint,
@@ -535,7 +583,6 @@ export default {
535
583
endStateBottom;
536
584
startStateHeight = QBlock .State .getStateHeight (startState);
537
585
endStateHeight = QBlock .State .getStateHeight (endState);
538
- // 因嵌套内部状态的xy是相对于父状态的,需手动计算状态的上边缘与下边缘的y坐标
539
586
startStateTop = QBlock .State .getXY2Canvas (startState, this .threadIndex ).y ;
540
587
endStateTop = QBlock .State .getXY2Canvas (endState, this .threadIndex ).y ;
541
588
startStateBottom =
@@ -727,7 +774,7 @@ export default {
727
774
return this .line .d ;
728
775
}
729
776
// if(!this.line.startPoint){
730
-
777
+
731
778
this .line .startPoint = QBlock .Line .getStartPoint (
732
779
this .line ,
733
780
this .threadIndex
@@ -771,31 +818,17 @@ export default {
771
818
fill : none ;
772
819
}
773
820
774
- .loop-in {
775
- stroke : @qkmLightGreen ;
776
- opacity : 0.9 ;
777
- fill : none ;
778
- }
779
- .loop-out {
780
- stroke : @qkmPurple ;
781
- opacity : 0.9 ;
782
- fill : none ;
783
- }
784
821
.connect-line {
785
822
stroke : @qkmGrey ;
786
823
fill : none ;
787
824
}
788
825
789
- .connect-line :hover ,
790
- .loop-in :hover ,
791
- .loop-out :hover {
826
+ .connect-line :hover {
792
827
stroke : @qkmLightBlue ;
793
828
fill : none ;
794
829
cursor : pointer ;
795
830
}
796
- .active .connect-line ,
797
- .active .loop-in ,
798
- .active .loop-out {
831
+ .active .connect-line {
799
832
stroke : @qkmLightBlue ;
800
833
fill : none ;
801
834
}
@@ -807,9 +840,7 @@ export default {
807
840
stroke : @qkmRed ;
808
841
fill : none ;
809
842
}
810
- .showdesc .connect-line ,
811
- .showdesc .loop-in ,
812
- .showdesc .loop-out {
843
+ .showdesc .connect-line {
813
844
stroke : @qkmYellow ;
814
845
fill : none ;
815
846
}
0 commit comments